compare the map speed of an array of random true/false values compared to an ArrayBuffer with a uInt8 view of 0 or 1. The results are that the typed array is much much faster. There are two possible reasons I can think of for this.
1) JavaScript boolean type size of 4Bytes where as an element of a uInt8 array is actually 1Byte.
2) The ArrayBuffer is allocating contiguous memory resulting in a better cache hit ratio.
Comparing performance of: numeric array vs Float64Array vs Float32Array
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
numeric array
Float64Array
Float32Array
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
2 months ago)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0