Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Demo benchmark
(version: 0)
From https://benchmarkjs.com/
Comparing performance of:
RegExp#test vs String#indexOf vs String#match vs String#includes
Created:
9 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div>This is demo</div>
Script Preparation code:
console.log("js preparation");
Tests:
RegExp#test
/benefit/.test('Is there a performance benefit to replacing == with ===?');
String#indexOf
'Is there a performance benefit to replacing == with ===?'.indexOf('benefit') > -1;
String#match
!!'Is there a performance benefit to replacing == with ===?'.match(/benefit/);
String#includes
'Is there a performance benefit to replacing == with ===?'.includes('benefit')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
RegExp#test
String#indexOf
String#match
String#includes
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!
Related benchmarks:
querySelectorAll vs getElementsByTagName iteration
GBCR Sequential Intense
testtesttesttesttest
querySelectorAll vs getElementsByTagName iteration 2
Arrays Destructuring
Comments
Confirm delete:
Do you really want to delete benchmark?