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.7M/s
Cached
25.5M/s
View exact numbers
Test name
Executions per second
✓
Not Cached
29,745,648 Ops/sec
Cached
25,542,142 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);