Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array manual search vs Regex.test (2)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
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:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.includes
81411760.0 Ops/sec
Regex.test
4362095.5 Ops/sec
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);