Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
splice vs copyWithin
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:154.0) Gecko/20100101 Firefox/154.0
Browser:
Firefox 154
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
20 days ago
Benchmark engine:
Benchmark.js
copyWithin()
25.7M/s
splice()
19.2M/s
View exact numbers
Test name
Executions per second
✓
copyWithin()
25,693,284 Ops/sec
splice()
19,168,448 Ops/sec
Script Preparation code:
var colors = ["red", "blue"]; var index = 1; var value = "white";
Tests:
splice()
colors.splice(index, 0, "white"); colors.splice(index, 1)
copyWithin()
colors.length++; colors.copyWithin(index + 1, index); colors[index] = value; colors.splice(index, 1)