Skip to content

Handle deeply nested lists#95

Merged
kivikakk merged 4 commits intomasterfrom
deeply-nested-links
Jun 20, 2018
Merged

Handle deeply nested lists#95
kivikakk merged 4 commits intomasterfrom
deeply-nested-links

Conversation

@philipturnbull
Copy link
Copy Markdown

This is the upstream fix for commonmark#255. Mostly clean, just a small merge conflict in the "many references" test

jgm and others added 4 commits April 14, 2018 21:41
We were needlessly redoing things we'd already done.
Now we skip the work if the first nonspace is greater
than the current offset.

This fixes pathological slowdown with deeply nested
lists (#255).  For N = 3000, the time goes from over
17s to about 0.7s.

Thanks to @mity for diagnosing the problem.
- commented out the (already ignored) "many references" test, which
  times out
- reduced the iterations for a couple other tests
@mity
Copy link
Copy Markdown

mity commented Apr 27, 2018

Nested lists, not links.

@kivikakk kivikakk merged commit b7a3b74 into master Jun 20, 2018
@kivikakk kivikakk deleted the deeply-nested-links branch June 20, 2018 06:13
@kivikakk kivikakk changed the title Handle deeply nested links Handle deeply nested lists Jun 21, 2018
talum pushed a commit that referenced this pull request Sep 14, 2021
* Optimize S_find_first_nonspace.

We were needlessly redoing things we'd already done.
Now we skip the work if the first nonspace is greater
than the current offset.

This fixes pathological slowdown with deeply nested
lists (#255).  For N = 3000, the time goes from over
17s to about 0.7s.

Thanks to @mity for diagnosing the problem.

* pathological_tests.py: added test for deeply nested lists.

* pathological_tests.py: make tests run faster.

- commented out the (already ignored) "many references" test, which
  times out
- reduced the iterations for a couple other tests
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

Successfully merging this pull request may close these issues.

4 participants