k-takata / Onigmo

Onigmo is a regular expressions library forked from Oniguruma.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

performance regression if quantifier lower bound is 1

lopex opened this issue · comments

Commit 282338f seems to prevent setting exact and map info for cases like:

/x+/ =~"aaaaaaaaaaaaaaaa"

or

/[b-z]+/ =~"aaaaaaaaaaaaaaaa"

resulting ten-fold performance regression.

The reason is that the else clause in optitmize_node_left (quantifier case) which propagates exact/map info is not triggered.

The simplest fix seems to be to just remove the else clause.

It seems that the commit 282338f doesn't improve the performance. I will revert it.