Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Linux
Desktop
one year ago
Benchmark.js
weird boolean - .fill
10.8M/s
uint8 .fill()
1.5M/s
weird boolean - Strict
1.2M/s
boolean array - Strict
196K/s
boolean array
181K/s
typed Array with uInt8 - Strict
161K/s
typed Array with uInt8
160K/s
View exact numbers
Test name Executions per second
weird boolean - .fill 10,767,318 Ops/sec
uint8 .fill() 1,494,658 Ops/sec
weird boolean - Strict 1,186,605 Ops/sec
boolean array - Strict 196,461 Ops/sec
boolean array 180,915 Ops/sec
typed Array with uInt8 - Strict 160,503 Ops/sec
typed Array with uInt8 160,211 Ops/sec
Script Preparation code:
Tests: