3 ms·
Is there any documentation on why to use a typed array
by pspeter3 9y ago
Is there any documentation on why to use a typed array
- yorwba 9y agoTyped arrays are essentially tightly packed chunks of memory that the GC won't walk. If you know what you're doing, you can use them to both save memory (shaving off the per-object overhead of JS objects) and reduce the time spent on GC collections (but you have to do your own memory management on the typed array). That the typed array contains only objects of a single data type probably also helps the JIT to optimize.