Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
test vs includes
Comparing regexes with string inclusion
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
Regex test
4275591.0 Ops/sec
String includes
3854047.2 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var features var isDesktopAlertsAllowed = true var isAlertsM2Allowed = true /*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { features = [ "Everything in Advisor Core", "Short & leveraged model portfolios", "Client proposals & reports (50/month)", "Custom report slides", "Multiple integrations", "Integration auto-refresh", "PDF broker statement upload", "PMS integrations", "Priority support" ] }
Tests:
Regex test
features.map((feat) => { if (/alerts/i.test(feat) && !isDesktopAlertsAllowed) { return false; } if (isAlertsM2Allowed && /watchlist alerts/i.test(feat)) { return false; } if (!isAlertsM2Allowed && /portfolio alerts/i.test(feat)) { return false; } return true; });
String includes
features.map((feat) => { const lowerFeat = feat.toLowerCase(); if (lowerFeat.includes('alerts') && !isDesktopAlertsAllowed) { return false; } if (isAlertsM2Allowed && lowerFeat.includes('watchlist alerts')) { return false; } if (!isAlertsM2Allowed && lowerFeat.includes('portfolio alerts')) { return false; } return true; });