Skip to content

Intern BinaryPacker.Element and EntityData values, and PlaybackData animation ids. - #1149

Open
JaThePlayer wants to merge 4 commits into
EverestAPI:devfrom
JaThePlayer:perf/intern
Open

Intern BinaryPacker.Element and EntityData values, and PlaybackData animation ids.#1149
JaThePlayer wants to merge 4 commits into
EverestAPI:devfrom
JaThePlayer:perf/intern

Conversation

@JaThePlayer

Copy link
Copy Markdown
Member

Saves ~50MB RAM and reduces allocated object count by ~2 millions with Strawberry Jam.

More results starting from here: https://discord.com/channels/403698615446536203/429775439423209472/1533091706080067657

@maddie480-bot maddie480-bot added the 1: review needed This PR needs 2 approvals to be merged (bot-managed) label Aug 1, 2026

@DashingCat DashingCat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on Discord, this PR initially broke the "Fast Level Loading" (FLL) PR #1072, but this was taken into account in the latest commits.

Besides the RAM save, this PR has an impact on loading performance:

Without changes, FLL disabled (current state):
 - LEVELS LOAD: 8829ms
 - LEVELS LOAD: 8696ms
 - LEVELS LOAD: 8646ms

With changes, FLL disabled:
 - LEVELS LOAD: 8799ms
 - LEVELS LOAD: 8956ms
 - LEVELS LOAD: 9002ms

Without changes, FLL enabled:
 - LEVELS LOAD: 7072ms
 - LEVELS LOAD: 7172ms
 - LEVELS LOAD: 7186ms

With changes, FLL enabled:
 - LEVELS LOAD: 8452ms
 - LEVELS LOAD: 8247ms
 - LEVELS LOAD: 8169ms

While this PR introduces a slowdown while loading levels, assuming we can merge both this PR and #1037, we should still have better both loading times and RAM usage, so I approve this PR.

@maddie480-bot

Copy link
Copy Markdown
Member

The pull request was approved and entered the 3-day last-call window.
If no further reviews happen, it will end on Aug 17, 2026, 7:50 PM UTC, after which the pull request will be able to be merged.

@maddie480-bot maddie480-bot added 3: last call window This PR was approved, and is in the 5-day last-call window before getting merged (bot-managed) and removed 1: review needed This PR needs 2 approvals to be merged (bot-managed) labels Aug 14, 2026
@wuke32767

Copy link
Copy Markdown
Contributor

here is my test result (only strawberry jam):

Slow Level Loading
 - LEVELS LOAD: 3046ms
 - LEVELS LOAD: 3165ms
 - LEVELS LOAD: 3074ms
Fast Level Loading
 - LEVELS LOAD: 5281ms
 - LEVELS LOAD: 4267ms
 - LEVELS LOAD: 4116ms
 - LEVELS LOAD: 4513ms
 - LEVELS LOAD: 4211ms

i'm trying two ways to optimize it a little, by replace the ConcurrentDictionary with _, but failed:

Fast Level Loading (Immutable)
 - LEVELS LOAD: 4556ms
 - LEVELS LOAD: 4536ms
 - LEVELS LOAD: 5490ms
 - LEVELS LOAD: 4158ms
 - LEVELS LOAD: 4539ms
Fast Level Loading (ThreadStatic)
 - LEVELS LOAD: 4272ms
 - LEVELS LOAD: 4608ms
 - LEVELS LOAD: 4408ms

@wuke32767

wuke32767 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

wait, i think i should nitpick it.
the FLL compatible stuff should be removed for now and opened in a new pr (or in FLL pr). currently this pr makes FLL slower.
[non-blocking]

@maddie480-bot

Copy link
Copy Markdown
Member

The last-call window for this pull request ended. It can now be merged if no blockers were brought up.

@maddie480-bot maddie480-bot added 4: ready to merge This PR was approved and the last-call window is over (bot-managed) and removed 3: last call window This PR was approved, and is in the 5-day last-call window before getting merged (bot-managed) labels Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4: ready to merge This PR was approved and the last-call window is over (bot-managed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants