Avoid redundant ZIP metadata decoding when loading saves - #988
Conversation
|
Separately, I have two larger save/load experiments in the fork: a bounded cache of immutable current-level data (fresh NPC/script state on every load), and background ZIP compression after capturing an owned save snapshot. Neither is included here. Would either design be worth discussing for upstream before I prepare a separate PR? |
|
For context, measured on the same Archolos save:
These are device measurements rather than controlled benchmarks, but the differences are large and repeatable. |
|
Also feel free to close it this PR, if not needed :) |
|
Hi @Solessfir ! Is it pretty-much replacing of |
|
Mostly, but there are two separate hot paths:
The remaining changes include calling So the main idea is avoiding full file stats where they are not needed, but the rest is not only moving code around. |
So the whole performance side of idea is to avoid
This one is nice.
No need here - this only bloats code-base. |
|
Yes, the performance change is avoiding It is O(1) - the expensive part here is its constant work: About the helpers and standalone tests - I’ll remove them. |
8742e4c to
f9e6a16
Compare
f9e6a16 to
9984b59
Compare
|
Merged, thanks! |
Wanna take a look at these? Can do PRs too. But they change way more but also cut way more time. |
Look for sure, but might take time before merge. |
|
Android port is done. I'm pretty happy with the current state. |
|
I don't think that you ever merge my fork, cuz it is 250+ commits and some fetures opinioneted, ex. Witcher style foliage fade near the camera - always hated leaves in the face in it the original game :) |
|
Just break it into parts. I presume apk/activity setup, touch ui, foliage - all can be separated into different PR's |
|
I can spam as many PR as you want. But would be cool to have some guidence of what you wanna see first and do you see full android merge in the end or you want only generic android stuff? Basically more PR/Project direction you gonna give - the better PRs I'm gonna do :) |
|
In term of direction. |
|
Got you! |
Avoid repeated ZIP metadata decoding when loading saves and release reader allocations when a Serialize object is destroyed.
No save-format changes, Android code, Ikarus changes, world caching or background saving.
On a roughly 35,000-entry save, the instrumented directory-counting stage dropped from about 1.3 seconds to 3 milliseconds. This is a stage measurement, not an overall loading-time claim.
Standalone archive tests passed with MSVC Release, covering direct-child counting, long names, stored/compressed entries, empty entries and CRC failures: