pmachata / dwgrep

a tool for querying Dwarf (debuginfo) graphs
http://pmachata.github.io/dwgrep/
GNU General Public License v3.0
53 stars 10 forks source link

Evaluation of long chains of "+" takes disproportionally long time. #7

Closed pmachata closed 9 years ago

pmachata commented 9 years ago
$ time ./dwgrep/dwgrep '()*******************'

real    0m0.006s
user    0m0.006s
sys 0m0.000s
$ time ./dwgrep/dwgrep '()+++++++++++++++++++'

real    0m6.406s
user    0m6.052s
sys 0m0.362s

It looks quadratic in number of +'s. X+ is translated as XX*, I suspect the long chain of +'s simply leads to a huge number of X instances.