Test name | Executions per second |
---|---|
Negative | 1105535.1 Ops/sec |
Lazy (non-greedy) | 1138304.8 Ops/sec |
/* 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";
[input.matchAll(negative)]; /* Array.from(input.matchAll(negative)); */
[input.matchAll(lazy)]; /* Array.from(input.matchAll(lazy)); */