Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
.slice() with .push() VS .slice() with .splice()
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
Browser:
Chrome 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
slice push
6719282.0 Ops/sec
slice splice
2004055.0 Ops/sec
Tests:
slice push
const input = [15,3,8,6,2,0,6,3,7,5,2,8,0,5,8,6,2,986,8,0,3,4,5,7,89,089,345,7,74,579,56,896,3456,14,3455,234,532234,56,435,6,3456,65,36,6,6543,45,3,6,6,6,634,34,56,54,34,6,3456,345,634,5634,56,46,6,53,456,54,4634,5,15,3,8,6,2,0,6,3,7,5,2,8,0,5,8,6,2,986,8,0,3,4,5,7,89,089,345,7,74,579,56,896,3456,14,3455,234,532234,56,435,6,3456,65,36,6,6543,45,3,6,6,6,634,34,56,54,34,6,3456,345,634,5634,56,46,6,53,456,54,4634,5] const merged = input.slice().push(42)
slice splice
const input = [15,3,8,6,2,0,6,3,7,5,2,8,0,5,8,6,2,986,8,0,3,4,5,7,89,089,345,7,74,579,56,896,3456,14,3455,234,532234,56,435,6,3456,65,36,6,6543,45,3,6,6,6,634,34,56,54,34,6,3456,345,634,5634,56,46,6,53,456,54,4634,5,15,3,8,6,2,0,6,3,7,5,2,8,0,5,8,6,2,986,8,0,3,4,5,7,89,089,345,7,74,579,56,896,3456,14,3455,234,532234,56,435,6,3456,65,36,6,6543,45,3,6,6,6,634,34,56,54,34,6,3456,345,634,5634,56,46,6,53,456,54,4634,5] const temp = input.slice() const merged = temp.splice(Infinity,0,42)