Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
TypedArray fill vs instantiation
(version: 1)
Is a reset by fill() that much slower than instantiating a new TypedArray, that frequent re-allocations is preferred?
Comparing performance of:
Instantiate vs Zero fill
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
let arr = new Float32Array(1000);
Tests:
Instantiate
arr = new Float32Array(1000);
Zero fill
arr.fill(0);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Instantiate
Zero fill
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser/OS:
Firefox 135 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Instantiate
1658207.5 Ops/sec
Zero fill
2190766.5 Ops/sec
Related benchmarks:
Array fill method vs for loop
fill array with value: map(callback) vs fill(value)
Array fill method vs for loop_
Array fill method vs for loop__
Array fill method vs push in for loop
TypedArray fill vs loop
fill vs manual fill
Array(length).fill() vs Array.from({ length: length })
Array() vs new Array() fill
Comments
Confirm delete:
Do you really want to delete benchmark?