Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Performance Test: substr vs substr_indexOf vs slice vs split
(version: 1)
Comparing performance of:
slice vs substr index vs substr vs split
Created:
7 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var string = "I am the god of hellfire, and I bring you..."
Tests:
slice
var substring = string.slice(17, 25);
substr index
var substring = string.substr(string.indexOf(','), 25);
substr
var substring = string.substr(17, 25);
split
var substring = string.split(',')[1];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
slice
substr index
substr
split
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?