Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Testing split vs lastindexOf
Testing split vs lastindexOf
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
lastindexof
75.0M/s
split and pop
43.5M/s
View exact numbers
Test name
Executions per second
✓
lastindexof
74,955,224 Ops/sec
split and pop
43,511,344 Ops/sec
Script Preparation code:
var s1 = "ALX:PLY:THE:Piano";
Tests:
split and pop
var n1 = s1.split(":").pop();
lastindexof
var n1 = s1.substring(s1.lastIndexOf(":") + 1);