⚡️ Performance: audit creating new objects in game logic #304
Labels
area: performance
Improving the speed of games.
package: timehandlr
status: accepting prs
Go ahead and send a pull request to resolve this issue!
Feature Request Checklist
main
branch of the repository.Overview
Browser GC (garbage collection) happens sporadically throughout a webpage's runtime and can cause little blips of bad performance. It's best to avoid creating new objects that will cause GC to have to run.
One common culprit is inline literals such as
[]
and{}
. I know I've seen them at least in thetimehandlr
codebase. I should do an audit of where those are created and try to avoid them.Additional Info
One common strategy is to use shared empty objects -- as long as nothing modifies them.
The text was updated successfully, but these errors were encountered: