Object vs Array vs Set Length Array vs TypedArray vs map vs setFastest: TypedArray (1.3x faster)
421 ops/sec
421 ops/sec
415 ops/sec
412 ops/sec
336 ops/sec
321 ops/sec
Fastest: TypedArray (27.8x faster)
21,969 ops/sec
11,360 ops/sec
10,723 ops/sec
10,233 ops/sec
867 ops/sec
789 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Object | |
| Array | |
| Set Length Array | |
| TypedArray | |
| map | |
| set |
| Test name | Executions per second |
|---|---|
| ✓ TypedArray | 62,504 Ops/sec |
| Set Length Array | 58,641 Ops/sec |
| Object | 42,294 Ops/sec |
| Array | 39,974 Ops/sec |
| map | 5,965 Ops/sec |
| set | 3,885 Ops/sec |