song loading performance overhaul w/ binary cache#180
Closed
realtasty wants to merge 1 commit intoKylemc1413:masterfrom
Closed
song loading performance overhaul w/ binary cache#180realtasty wants to merge 1 commit intoKylemc1413:masterfrom
realtasty wants to merge 1 commit intoKylemc1413:masterfrom
Conversation
- added a binary cache (BinaryCache.cs) that stores hashes, durations, level IDs, and info.dat contents in a single file instead of the three separate json caches, auto-migrates from the old format on first run - in the main loading loop, if a song folder's timestamp matches what we have cached we just reconstruct the BeatmapLevel from memory instead of touching the disk at all - capped the parallelism to 8 threads max since on higher core count machines it was starving the main thread and causing the game to hang - made the cache save synchronous on the background thread so it doesn't get lost if the game exits right after loading - fixed a bug where the cache was gated behind the fullRefresh flag, meaning it was actually never used on startup since fullRefresh defaults to true - simplified GetDirectoryHash to just use the folder's last write timestamp instead of enumerating every file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added a binary cache (BinaryCache.cs) that stores hashes, durations, level IDs, and info.dat contents in a single file instead of the three separate json caches, auto-migrates from the old format on first run
in the main loading loop, if a song folder's timestamp matches what we have cached we just reconstruct the BeatmapLevel from memory instead of touching the disk at all
capped the parallelism to 8 threads max since on higher core count machines it was starving the main thread and causing the game to hang
made the cache save synchronous on the background thread so it doesn't get lost if the game exits right after loading
fixed a bug where the cache was gated behind the fullRefresh flag, meaning it was actually never used on startup since fullRefresh defaults to true
simplified GetDirectoryHash to just use the folder's last write timestamp instead of enumerating every file