Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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
Test name
Executions per second
Deleting through length
17404136.0 Ops/sec
Deleting through spclie
19989112.0 Ops/sec
Slicing
20877090.0 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);