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
Cache improvements and effect caching #1760
Conversation
Update const-argument order.
…now deleted when the memory threshold is exceeded. Dummy assets are now cached: Improves Game Browser startup time
The flicker fix also will contain yet another minor improvement: It saves 258 KB per CharSet that is affected by a screen effect. Saves a non measurable amount for "The Looking Glass" and 2 MB in Yume2kki. The "Operator <" is required for keys in std::map. |
Reduces the memory usage significantly when a screen flash or tone is applied because this created new bitmaps for each event before. Fix EasyRPG#1755
…src_rect_effect). Sprite rects are only used by Charsets, this change saves 250 KB per individual charset when a screen effect is used. For all other cases sprite rect == bitmap rect.
I can make it non-const. |
Unless it's going to be exposed as a runtime config parameter I would leave it constexpr, at least then you can maybe eke out some additional compile time optimizations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this LGTM, though I admit I am not that familiar with this corner of the code.
not ready yet, have strange flickering.
Improved the caching strategy, before our Cache was unlimited and never cleared any recently (<5s) used assets. Now the clear is forced when the memory usage is 10 MB (+3 MB SE).
Which means the memory foodprint is in simple games (havn't used the MSVC memory profiler yet) ~20 MB plus Database.
Besides reduced memory usage the effect cache should also help in some situations to make the effect faster because tone & flash are only calculated once now per same charset.
Related #1177