Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: performance budgeting #247

Merged
merged 6 commits into from
Jan 9, 2024
Merged

Conversation

NickKhalow
Copy link
Contributor

In the previous contract there was many implementations that violates LSP with empty method that ignores call. To get rid off it here is introduced:

PerformanceBudget that allows only spend a budget. Also according on the concern that object solves it was renamed from Budget Provider to Performance Budget

IConcurrentBudgetProvider -> IReleasablePerformanceBudget renamed as well

IConcurrentBudgetProvider -> IReleasablePerformanceBudget
Copy link
Collaborator

@popuz popuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most clients using only TrySpend method, so they can rely on IPerformanceBudget interface instead of IReleasablePerformanceBudget. I commented one case, but please check it in all other clients.

Same probably true for IReleasablePerformanceBudget, where client only uses TryRelease method, but this one is up to you if you want to refactor it further

@NickKhalow NickKhalow enabled auto-merge (squash) January 9, 2024 14:38
# Conflicts:
#	Explorer/Assets/DCL/PluginSystem/World/TextShapePlugin.cs
@NickKhalow NickKhalow merged commit 6832a2b into main Jan 9, 2024
3 checks passed
@NickKhalow NickKhalow deleted the chore/budgeting-refactor branch January 9, 2024 14:59
Copy link
Contributor

github-actions bot commented Jan 9, 2024

badge

Windows build successfull! You can find a link to the downloadable artifact below.

Name Link
Commit a36e618
Logs https://github.com/decentraland/unity-explorer/actions/runs/7462566886
Download https://github.com/decentraland/unity-explorer/suites/19634362512/artifacts/1156971464

Kinerius pushed a commit that referenced this pull request Feb 20, 2024
* IReadOnlyDictionary for memoryThreshold

* Introduced PerformanceBudget

IConcurrentBudgetProvider -> IReleasablePerformanceBudget

* replace usage to IPerformanceBudget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants