Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array manual search vs Regex.test (2)
(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=1 ; i < box.length-1 ; i++) { for(let j=1 ; j < box[i].length-1 ; 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.includes
81411760.0 Ops/sec
Regex.test
4362095.5 Ops/sec
Related benchmarks:
Array.includes vs String.match
Array.includes vs String.match
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()
Array manual search vs Regex.test
Comments
Confirm delete:
Do you really want to delete benchmark?