Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Create Float32Array via unpacking or concat?
(version: 1)
Is it faster to create Arrays or Float32Arrays when combining many arrays into a big one
Comparing performance of:
Arrays vs Float32Arrays vs Concat
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var newArray = () => { return [1, 2, 3, 4, 5]; } var newF32Array = () => { return new Float32Array([1, 2, 3, 4, 5]); }
Tests:
Arrays
let array = []; for (let i=0; i<1000; i++) { array.push(...newArray()); }
Float32Arrays
let array = []; for (let i=0; i<1000; i++) { array.push(...newF32Array()); }
Concat
let array = []; for (let i=0; i<1000; i++) { array = array.concat(newArray()) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Arrays
Float32Arrays
Concat
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15
Browser/OS:
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Arrays
61616.4 Ops/sec
Float32Arrays
9530.7 Ops/sec
Concat
1382.2 Ops/sec
Related benchmarks:
array vs int32array3
TypedArray performance
Push to: array vs float32array performance test
Push to: array vs float32array performance test 2
Push to: array vs float32array performance test 3
number vs float32array vs Uint32Array test 2
slice vs subarray vs set - million elements
Using at() vs [offset + n] for multiple assignment
Array vs TypedArray vs f32 write performance
Comments
Confirm delete:
Do you really want to delete benchmark?