Should I create an ArrayBuffer every time or should I clear the previously created?

I need an ArrayBuffer having a size (65536 * 2). When you create an ArrayBuffer, it contains all the zeros that are convenient.

Now that I need a clean (zero-filled) ArrayBuffer, should I create a new local instance or create a global instance that I clean up (using the Uint32 view) every time I need to?

I need to use this buffer once every 10 seconds, and it should give the same performance for all major browsers. Any experience / thoughts on this?

Thanks in advance...

+4
source share

All Articles