Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RegExp: negative vs lazy (non-greedy)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 133
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Negative
533940.2 Ops/sec
Lazy (non-greedy)
547560.4 Ops/sec
Script Preparation code:
/* André Antunes da Cunha - hello world! */ var negative = /<[^>]*>/g; var lazy = /<.*?>/g; var input = "hello <01> hello <02> hello <03> hello <04> hello <05> hello <06> hello <07> hello <08> hello <09> hello <10> " + "hello <11> hello <12> hello <13> hello <14> hello <15> hello <16> hello <17> hello <18> hello <19> hello <20> " + "hello";
Tests:
Negative
[...input.matchAll(negative)]; /* Array.from(input.matchAll(negative)); */
Lazy (non-greedy)
[...input.matchAll(lazy)]; /* Array.from(input.matchAll(lazy)); */