Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
array.length vs array.splice
Want to make sure that delete last elements through length is faster.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0
Browser:
Chrome 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Slicing
20.9M/s
Deleting through spclie
20.0M/s
Deleting through length
17.4M/s
View exact numbers
Test name
Executions per second
✓
Slicing
20,877,090 Ops/sec
Deleting through spclie
19,989,112 Ops/sec
Deleting through length
17,404,136 Ops/sec
Script Preparation code:
var sut = []; for (let i = 0; i < 10000; i++) { sut.push(i); }
Tests:
Deleting through length
sut.length = 10;
Deleting through spclie
sut.splice(10, 9000);
Slicing
sut.slice(10);