boolean array vs typed Array with uInt8 vs boolean array - Strict vs typed Array with uInt8 - Strict vs weird boolean - Strict vs uint8 .fill() vs weird boolean - .fillFastest: weird boolean - .fill (311.0x faster)
24,851,132 ops/sec
22,281,420 ops/sec
515,184 ops/sec
404,687 ops/sec
377,665 ops/sec
93,113 ops/sec
79,914 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| boolean array | |
| typed Array with uInt8 | |
| boolean array - Strict | |
| typed Array with uInt8 - Strict | |
| weird boolean - Strict | |
| uint8 .fill() | |
| weird boolean - .fill |
| Test name | Executions per second |
|---|---|
| ✓ weird boolean - .fill | 27,392,968 Ops/sec |
| uint8 .fill() | 25,077,322 Ops/sec |
| weird boolean - Strict | 580,057 Ops/sec |
| boolean array - Strict | 431,249 Ops/sec |
| boolean array | 425,621 Ops/sec |
| typed Array with uInt8 - Strict | 90,247 Ops/sec |
| typed Array with uInt8 | 77,757 Ops/sec |