Reuse objects as often as possible. If you create dozens of objects (for example, vectors and matrices) for each rendered frame, you will definitely get a GC-related stutter. Therefore, when you use a scene-based approach to render your game, you might want to cache objects in the nodes of the scene graph, for example. Or you can use the object pool template . In other languages, such as Java, this method is deprecated because object creation and GC are so fast today that the object pool no longer helps. But in JavaScript this can still help.
GC-stutter JavaScript, , , 2D- , . , . .
2D-:
http://www.ailis.de/~k/hg/javascript/twodee/file/tip/src/main/javascript/twodee
, , / / .