Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Javascript slice vs substring
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Android
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Substr
6.2M/s
Slice
6.2M/s
Substring
6.1M/s
View exact numbers
Test name
Executions per second
✓
Substr
6,187,185 Ops/sec
Slice
6,179,306 Ops/sec
Substring
6,125,938 Ops/sec
Script Preparation code:
var text = '$test';
Tests:
Substring
text = text.substring(1, text.length);
Slice
text = text.slice(1, text.length);
Substr
text = text.substr(1, text.length);