Closed nwellnhof closed 3 years ago
Simply parsing a sequence of single or double quote characters exhibits quadratic behavior when the "smart" option is enabled:
$ for n in 5000 10000 20000; do python3 -c "print(\"'\"*$n)" |time -f "$n chars: %e secs" build/src/cmark --smart >/dev/null; done 5000 chars: 0.15 secs 10000 chars: 0.70 secs 20000 chars: 4.33 secs
This seems to be caused by this loop in process_emphasis.
process_emphasis
Simply parsing a sequence of single or double quote characters exhibits quadratic behavior when the "smart" option is enabled:
This seems to be caused by this loop in
process_emphasis
.