Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
TypedArray fill vs instantiation
Is a reset by fill() that much slower than instantiating a new TypedArray, that frequent re-allocations is preferred?
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Zero fill
2.2M/s
Instantiate
1.7M/s
View exact numbers
Test name
Executions per second
✓
Zero fill
2,190,766 Ops/sec
Instantiate
1,658,208 Ops/sec
Script Preparation code:
let arr = new Float32Array(1000);
Tests:
Instantiate
arr = new Float32Array(1000);
Zero fill
arr.fill(0);