libgif-js icon indicating copy to clipboard operation
libgif-js copied to clipboard

Use Uint8Array for more efficient loading of GIF frame data

Open jbaicoianu opened this issue 8 years ago • 5 comments

This change results in an approximately 10x speedup when parsing large GIFs. This is accomplished by using Uint8Array instead of binary strings, and using block memory allocators to increase memory efficiency/reduce GC load.

Using a basic for loop instead of pixels.forEach() to populate the canvas pixeldata also gave a significant performance boost.

jbaicoianu avatar May 11 '16 09:05 jbaicoianu