Skip to content

State loading optimizations - #1541

Draft
booky10 wants to merge 9 commits into
retrooper:2.0from
booky10:feat/state-loading-optimizations
Draft

State loading optimizations#1541
booky10 wants to merge 9 commits into
retrooper:2.0from
booky10:feat/state-loading-optimizations

Conversation

@booky10

@booky10 booky10 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

See individual commits for more details, but essentially:

  • Reduced retained memory after states have been loaded (array instead of map and no longer allocates some ints)
  • Reduced allocations during state loading (e.g. sequential nbt reading now only uses one entry object)
  • Buffer gzip input stream (buffer was previously placed incorrectly)
  • Always compare/hash state types + nbt types by object identity

On my device, all states now load in about 1.3s-1.5s instead of 2.1s-2.3s like before


Some async profiler reports:

If someone sees/finds anything in there which could be further optimized, please let me know!


Initially marked as a draft as I still need to test + check if everything is behaving correctly

(thanks to MissingReports on Discord for suggesting to take a look at this!)

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.

1 participant