Skip to content

perf: Cache directories in background before parsing#19

Merged
ersh1 merged 2 commits into
ersh1:mainfrom
SimplisticMind:main
May 10, 2026
Merged

perf: Cache directories in background before parsing#19
ersh1 merged 2 commits into
ersh1:mainfrom
SimplisticMind:main

Conversation

@SimplisticMind

Copy link
Copy Markdown
Contributor

Title.
Warm disk cache, current version:

[02:50:17.214] [36548] [I]   Parsing: 8021ms
[02:50:17.214] [36548] [I]   Adding mods: 87ms
[02:50:17.214] [36548] [I]   Adding legacy mods: 35ms
[02:50:17.214] [36548] [I]   Checking for problems: 0ms
[02:50:17.214] [36548] [I]   Total: 8145ms
[02:50:18.646] [36548] [I] Time spent creating replacement animations for Actors\Character\:
[02:50:18.646] [36548] [I]   Parsing: 1064ms
[02:50:18.646] [36548] [I]   Updating animations in submods: 111ms
[02:50:18.646] [36548] [I]   Initializing replacment animations: 0ms
[02:50:18.646] [36548] [I]   Total: 1175ms
[02:50:20.470] [36548] [I] Time spent creating replacement animations for Actors\Character\:
[02:50:20.470] [36548] [I]   Parsing: 1150ms
[02:50:20.470] [36548] [I]   Updating animations in submods: 212ms
[02:50:20.470] [36548] [I]   Initializing replacment animations: 0ms
[02:50:20.470] [36548] [I]   Total: 1363ms

(with a total of 10.6s spent in tracked parts)
Warm disk cache, this fork:

[03:29:04.502] [43044] [I] Time spent creating replacer mods:
[03:29:04.502] [43044] [I]   Parsing: 7ms
[03:29:04.502] [43044] [I]   Adding mods: 412ms
[03:29:04.502] [43044] [I]   Adding legacy mods: 44ms
[03:29:04.502] [43044] [I]   Checking for problems: 0ms
[03:29:04.502] [43044] [I]   Total: 465ms
[03:29:04.970] [43044] [I] Time spent creating replacement animations for Actors\Character\:
[03:29:04.970] [43044] [I]   Parsing: 123ms
[03:29:04.970] [43044] [I]   Updating animations in submods: 65ms
[03:29:04.970] [43044] [I]   Initializing replacment animations: 0ms
[03:29:04.970] [43044] [I]   Total: 189ms
[03:29:05.849] [43044] [I] Time spent creating replacement animations for Actors\Character\:
[03:29:05.849] [43044] [I]   Parsing: 175ms
[03:29:05.849] [43044] [I]   Updating animations in submods: 177ms
[03:29:05.849] [43044] [I]   Initializing replacment animations: 0ms
[03:29:05.849] [43044] [I]   Total: 353ms

(with a total of 1s spent in tracked parts)

Cold disk cache will present even more perf gain as the IO load is spread across the entire loading process instead of being concentrated in one place.

Caveats to be aware of:

  • I wouldn't suggest caching more stuff than is already done as the time spent caching is getting close to saturated on a cold disk cache.
  • Was not tested on Linux/Wine - it may handle the IO priority poorly.
  • Be careful when optimizing the caching path to not create additional IO burden as it may choke other game loading stuff.
  • Mutexes have been switched to std variants as CommonLibSSE locks are quite expensive (and provide, seemingly, no actual gain)

@ersh1

ersh1 commented May 10, 2026

Copy link
Copy Markdown
Owner

That's fantastic. Thank you!

@ersh1
ersh1 merged commit 2b82c1f into ersh1:main May 10, 2026
@Textolyte

Copy link
Copy Markdown

Thank you so much for this fork! Restart time has dropped by 7 seconds, from total 32 seconds to 25 seconds on the PCIe 5. OAR load 8 sec to 2.12 sec. ❤️

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.

3 participants