Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array manual search vs Regex.test
(version: 1)
Comparing performance of:
Array.includes vs Regex.test
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
Array.includes
const box = ['###','#*#', '###']; for(let i=0 ; i < box.length ; i++) { for(let j=0 ; j < box[i].length ; j++) { if(box[i][j] === '*') { return true; } } } return false;
Regex.test
const regex = /\*/; const box = ['###','#*#','###']; regex.test(box);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.includes
Regex.test
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser/OS:
Chrome 129 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.includes
10166660.0 Ops/sec
Regex.test
1535000.2 Ops/sec
Related benchmarks:
Test checker
Regex vs Forloop Performance
Regex vs String.includes in Array.filter v2
RegEx.test vs. String.includes vs. for
regex vs startWith
Regexp test VS array.every and includes
RegExp.test() vs Array.includes()
String.includes vs Regex.test
Array manual search vs Regex.test (2)
Comments
Confirm delete:
Do you really want to delete benchmark?