Skip to content

Optimize datapackage cache operations#30

Merged
N00byKing merged 1 commit intoN00byKing:mainfrom
KScl:opt_datapkg_cache
Oct 18, 2025
Merged

Optimize datapackage cache operations#30
N00byKing merged 1 commit intoN00byKing:mainfrom
KScl:opt_datapkg_cache

Conversation

@KScl
Copy link
Contributor

@KScl KScl commented Oct 18, 2025

  • The result of datapkg_cache.get("games", Json::objectValue) is always going to be the same; however with a datapackage cache of a significant size, this repeatedly causes a lengthy copy operation for every single game in the multiworld. This results in a significantly long delay on startup in big asyncs with a wide variety of games, even when the datapackages all match. Splitting this operation up like this makes checking for outdated game datapackages significantly faster (near instant).
  • There's no point in calling parseDataPkg() early if there are still outdated games we haven't received datapackages for yet, all the work it does will just be overwritten later. Saving this operation until the end and only calling it once speeds up fetching new datapackages significantly, without changing functionality at all.

@N00byKing
Copy link
Owner

Thanks!

@N00byKing N00byKing merged commit d9c0e92 into N00byKing:main Oct 18, 2025
2 checks passed
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.

2 participants