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
Jump 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
Test name
Executions per second
slice
3712.9 Ops/sec
splice
201214192.0 Ops/sec
Related benchmarks:
Every Third Element
Array creation
Cloning arrays
Splice vs [...]
Splice vs deconstruction based copy
Slice vs deconstruction based copy
Some reorder test (not reverse)
push vs splice mytest
Array last index
Comments
Confirm delete:
Do you really want to delete benchmark?