Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
jl-20250123b
(version: 1)
Comparing performance of:
slice vs splice
Created:
one year ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const largeArray = new Array(200000).fill(0); const step = 10 let copy = [...largeArray]
Tests:
slice
for(let i=0; i<largeArray.length; i+=step){ let temp = largeArray.slice(i, i+step) }
splice
for(let i=0; copy.length > 0; i++){ let temp = copy.splice(0, step) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
slice
splice
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
splice
201.2M/s
slice
4K/s
View exact numbers
Test name
Executions per second
✓
splice
201,214,192 Ops/sec
slice
3,713 Ops/sec
Related benchmarks
Cloning arrays
Slice vs deconstruction based copy
Array last index
Comments
Confirm delete:
Do you really want to delete benchmark?