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 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Negative
1351113.9 Ops/sec
Lazy (non-greedy)
1341004.8 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)); */