Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
DataView vs Uint8Array by bytes vs Uint8Array set Uint8Array
(version: 0)
Comparing performance of:
DataView vs Uint8Array by byte vs Uint8Array with set vs Uint8Array with set other Uint8Array
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var size = 0xFF; var buf = new ArrayBuffer(size); var view = new DataView(buf); var byte = new Uint8Array(buf); var data = []; for (let i = 0; i < size; i++) { data[i] = 100 * Math.random(); } var dataBytes = new Uint8Array(data);
Tests:
DataView
for (let i; i < size; i++) { view.setUint8(i, data[i]); }
Uint8Array by byte
for (let i; i < size; i++) { byte[i] = data[i]; }
Uint8Array with set
byte.set(data, 0);
Uint8Array with set other Uint8Array
byte.set(dataBytes, 0);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
DataView
Uint8Array by byte
Uint8Array with set
Uint8Array with set other Uint8Array
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
DataView vs Uint8Array by bytes
copy ArrayBuffer: DataView vs Uint8Array.set vs Float64Array.set vs by bytes
DataView vs Uint8Array by bytes vs Native Array
DataView vs Uint8Array by bytes vs Uint8Array set Uint8Array vs DataView loop
copy ArrayBuffer: DataView vs Uint8Array.set vs Float64Array.set vs by bytes (2)
Comments
Confirm delete:
Do you really want to delete benchmark?