Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Cache js regex
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 12; Mobile; rv:131.0) Gecko/131.0 Firefox/131.0
Browser:
Firefox Mobile 131
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
Not Cached
29.3M/s
Cached
24.6M/s
View exact numbers
Test name
Executions per second
✓
Not Cached
29,294,792 Ops/sec
Cached
24,562,526 Ops/sec
Script Preparation code:
var regex = /^\d+$/; var regularTest = value => { const pass = /^\d+$/.test(value); return !pass; }; var cachedTest = value => { const pass = regex.test(value); return !pass; };
Tests:
Not Cached
regularTest(555);
Cached
cachedTest(555);