Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing [](([](([]((… takes quadratic time #734

Closed
andersk opened this issue Nov 20, 2020 · 1 comment
Closed

Parsing [](([](([]((… takes quadratic time #734

andersk opened this issue Nov 20, 2020 · 1 comment

Comments

@andersk
Copy link

andersk commented Nov 20, 2020

Although #732 []([]([](… was fixed by 1910a3c:

$ time node -e 'require("markdown-it")().render("[](".repeat(80000))'     
0.15user 0.02system 0:00.15elapsed 114%CPU (0avgtext+0avgdata 50616maxresident)k
0inputs+0outputs (0major+6451minor)pagefaults 0swaps

this variant [](([](([]((… was not:

$ time node -e 'require("markdown-it")().render("[]((".repeat(10000))'
0.72user 0.01system 0:00.72elapsed 102%CPU (0avgtext+0avgdata 40368maxresident)k
0inputs+0outputs (0major+4075minor)pagefaults 0swaps
$ time node -e 'require("markdown-it")().render("[]((".repeat(20000))'
2.28user 0.01system 0:02.27elapsed 100%CPU (0avgtext+0avgdata 42448maxresident)k
0inputs+0outputs (0major+4599minor)pagefaults 0swaps
$ time node -e 'require("markdown-it")().render("[]((".repeat(40000))'
8.32user 0.01system 0:08.32elapsed 100%CPU (0avgtext+0avgdata 47952maxresident)k
0inputs+0outputs (0major+5905minor)pagefaults 0swaps
$ time node -e 'require("markdown-it")().render("[]((".repeat(80000))'
31.11user 0.01system 0:31.14elapsed 99%CPU (0avgtext+0avgdata 53380maxresident)k
0inputs+0outputs (0major+10046minor)pagefaults 0swaps
@rlidwka
Copy link
Member

rlidwka commented Nov 23, 2020

Fixed by b1651b1 and 537ab89 (found two different issues while investigating this pattern).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants