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

Only compute store/caching stats when the memory panel is opened #5274

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Feb 24, 2024

Computing stats for the store and caches is a very costly process.

We do so every frame because the memory panel's data gets updated whether it is opened or not, so that the memory graphs are not missing any data when you eventually open it.

In the case of the store, we've added a lot of complexity a long time ago to make that process fast enough (although in a big enough scene, it will still take a non-trivial amount of time).
I've recently gone through the process of adding the same kind of complexity to the caches, but it gets absolutely insane -- so insane that it's just not worth it.

So, instead of making the caches even more complicated than they already are just so the memory panel can get updated in the background, we've decided to just not updated the mempanel stats when it's hidden.

Before:
image

After (mempanel opened):
image

After (mempanel hidden):
image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

@teh-cmc teh-cmc added 🧑‍💻 dev experience developer experience (excluding CI) 🚀 performance Optimization, memory use, etc exclude from changelog PRs with this won't show up in CHANGELOG.md labels Feb 24, 2024
@Wumpf Wumpf self-requested a review February 26, 2024 09:00
@Wumpf Wumpf added include in changelog and removed exclude from changelog PRs with this won't show up in CHANGELOG.md labels Feb 26, 2024
@Wumpf
Copy link
Member

Wumpf commented Feb 26, 2024

adding it to the changelog since it's such a big perf impact on some scenes

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

so simple <3

@Wumpf Wumpf merged commit e3d49d5 into main Feb 26, 2024
44 of 45 checks passed
@Wumpf Wumpf deleted the cmc/no_panel_no_stats branch February 26, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 dev experience developer experience (excluding CI) include in changelog 🚀 performance Optimization, memory use, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants