Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array vs Uint8Array vs Uint16Array vs Uint32Array vs BigInt64Array
(version: 1)
Comparing performance of:
Array vs Uint8Array vs Uint16Array vs Uint32Array vs BigInt64Array
Created:
3 months ago
by:
Guest
Jump to the latest result
Tests:
Array
var arr = new Array(1500000).fill(0); for (let i=0; i<arr.length; i++) { arr[i] = arr[i] + 1; }
Uint8Array
var arr = new Uint16Array(1500000).fill(0); for (let i=0; i<arr.length; i++) { arr[i] = arr[i] + 1; }
Uint16Array
var arr = new Uint16Array(1500000).fill(0); for (let i=0; i<arr.length; i++) { arr[i] = arr[i] + 1; }
Uint32Array
var arr = new Uint32Array(1500000).fill(0); for (let i=0; i<arr.length; i++) { arr[i] = arr[i] + 1; }
BigInt64Array
var arr = new BigInt64Array(1500000).fill(0n); for (let i=0; i<arr.length; i++) { arr[i] = arr[i] + 1n; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
Array
Uint8Array
Uint16Array
Uint32Array
BigInt64Array
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Browser/OS:
Chrome 146 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array
951.7 Ops/sec
Uint8Array
1500.9 Ops/sec
Uint16Array
1475.8 Ops/sec
Uint32Array
1140.9 Ops/sec
BigInt64Array
812.2 Ops/sec
Related benchmarks:
Shifting array elements
UInt8Array vs cast to array index access
UInt8Array vs cast to array index access 10k
Array vs TypedArray write performance
Uint8Array vs Uint8ClampedArray - more numbers
Array vs TypedArray read performance
very big Array vs TypedArray write performance
Array vs TypedArray vs f32 write performance
Array vs TypedArray write performance (Int32Array)
Comments
Confirm delete:
Do you really want to delete benchmark?