DataView vs Uint8Array by byte vs Uint8Array with setFastest: Uint8Array by byte (16.0x faster)
25,996,158 ops/sec
25,978,046 ops/sec
1,625,429 ops/sec
Fastest: DataView (1824.2x faster)
1,009,463,552 ops/sec
794,914,304 ops/sec
553,386 ops/sec
Fastest: Uint8Array by byte (14.3x faster)
15,698,158 ops/sec
15,637,969 ops/sec
1,095,998 ops/sec
Fastest: DataView (124.2x faster)
205,791,488 ops/sec
184,314,512 ops/sec
1,657,535 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| DataView | |
| Uint8Array by byte | |
| Uint8Array with set |
| Test name | Executions per second |
|---|---|
| ✓ Uint8Array by byte | 2,058,639,488 Ops/sec |
| DataView | 2,021,099,264 Ops/sec |
| Uint8Array with set | 1,076,342 Ops/sec |