Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Conversation

@Supercolbat
Copy link

@Supercolbat Supercolbat commented Jan 16, 2024

The visible result of these changes can only be seen on games that make heavy of use setLegend. The memory-intensive blocks of code were found through the Firefox memory profiler.

On Firefox, these games would suffer from high memory usage and lag spikes from garbage collection. The same does not occur on Chromium-based browsers.

sprig-engine-perf.mp4

Games tested in the screen recording: ROOM and Taiko Fever.

Firefox
ROOM on max resolution still lags and has occasional lockups even after these changes, because it's an absolute beast. When not run alongside 3 other RAM blackholes, Taiko Fever runs with very subtle lag spikes.

Chrome
ROOM on max resolution still lags sometimes but doesn't lock up for several seconds like before. Taiko Fever works great.

getState(): GameState // For weird backwards-compatibility reasons, not part of API
}

const SPRITE_CACHE_SIZE = 64;
Copy link
Author

Choose a reason for hiding this comment

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

This value was chosen after determining that 16 and 32 didn't have a noticable impact.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant