Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Chrome 131
Windows
Desktop
one year ago
Benchmark.js
weird boolean - .fill
27.1M/s
uint8 .fill()
23.9M/s
weird boolean - Strict
450K/s
boolean array - Strict
351K/s
boolean array
330K/s
typed Array with uInt8 - Strict
70K/s
typed Array with uInt8
66K/s
View exact numbers
Test name Executions per second
weird boolean - .fill 27,130,212 Ops/sec
uint8 .fill() 23,882,308 Ops/sec
weird boolean - Strict 450,312 Ops/sec
boolean array - Strict 351,308 Ops/sec
boolean array 329,708 Ops/sec
typed Array with uInt8 - Strict 69,582 Ops/sec
typed Array with uInt8 66,170 Ops/sec
Script Preparation code:
Tests: