Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
split vs slice
Javascript split vs slice performance
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/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
split
5.4M/s
slice
2.5M/s
View exact numbers
Test name
Executions per second
✓
split
5,359,175 Ops/sec
slice
2,466,577 Ops/sec
Script Preparation code:
var rgb = "rgba(255,255,255,0.7)";
Tests:
slice
rgb.split("(")[1].slice(0, -1).split(",");
split
rgb.split("(")[1].split(")")[0].split(",")