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:
one month ago
by:
Guest
Jump 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:
one month 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
Test name
Executions per second
startsWith
980868864.0 Ops/sec
substr
975338880.0 Ops/sec
Related benchmarks:
startswith vs includes
startswith vs includes vs substring
startswith vs includes (leading part of string)
startswith vs includes vs indexOf (leading part of string)
startswith vs includes - same string
startswith vs includes simple
startsWith vs includes('something', 0)
startswith vs includes (exact string)
startswith vs includes for same string
Comments
Confirm delete:
Do you really want to delete benchmark?