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
Test name
Executions per second
Instantiate
1658207.5 Ops/sec
Zero fill
2190766.5 Ops/sec
Script Preparation code:
let arr = new Float32Array(1000);
Tests:
Instantiate
arr = new Float32Array(1000);
Zero fill
arr.fill(0);