Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
set vs array mod
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
array.push
289K/s
array.shift
147K/s
set.delete
72K/s
set.add
16K/s
View exact numbers
Test name
Executions per second
✓
array.push
288,903 Ops/sec
array.shift
146,822 Ops/sec
set.delete
72,129 Ops/sec
set.add
15,536 Ops/sec
Script Preparation code:
const b = [] for (let i = 0; i < 3000; i++) b.push(i) const c = new Set(b);
Tests:
array.push
const a = [] for (let i = 0; i < 3000; i++) a.push(i)
set.add
const s = new Set() for (let i = 0; i < 3000; i++) s.add(i)
array.shift
for (let i = 0; i < 3000; i++) b.shift()
set.delete
for (let i = 0; i < 3000; i++) c.delete(i)