Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15
Safari 18
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
weird boolean - .fill
73.6M/s
uint8 .fill()
52.9M/s
weird boolean - Strict
12.9M/s
typed Array with uInt8
2.2M/s
typed Array with uInt8 - Strict
2.2M/s
boolean array
796K/s
boolean array - Strict
718K/s
View exact numbers
Test name Executions per second
weird boolean - .fill 73,618,520 Ops/sec
uint8 .fill() 52,906,320 Ops/sec
weird boolean - Strict 12,857,642 Ops/sec
typed Array with uInt8 2,178,973 Ops/sec
typed Array with uInt8 - Strict 2,161,385 Ops/sec
boolean array 796,062 Ops/sec
boolean array - Strict 717,859 Ops/sec
Script Preparation code:
Tests: