Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
includes vs substring
(version: 1)
Comparing performance of:
startsWith vs substr
Created:
5 months ago
by:
Guest
Go to the latest result
Tests:
startsWith
const str = "https://firebase.com/this/is/a/long/thing" str.includes("https://firebase")
substr
const str = "https://firebase.com/this/is/a/long/thing" const subStr = str.substring(0, 16); str === subStr
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
startsWith
substr
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0
Browser/OS:
Firefox 143 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
startsWith
980.9M/s
substr
975.3M/s
View exact numbers
Test name
Executions per second
✓
startsWith
980,868,864 Ops/sec
substr
975,338,880 Ops/sec
Related benchmarks
startswith vs includes
startswith vs includes vs indexOf (leading part of string)
startswith vs includes simple
startswith vs includes for same string
Comments
Confirm delete:
Do you really want to delete benchmark?