Performance drops exponentially with deeply nested lists
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
Hey,
we have found a possible performance bug with our code - one of our BE engineers copy/pasted deeply nested HTML structure and suddenly the elm-format takes 20s on 500 lines file. We were able to narrow the problem to having deeply nested lists - I have created SSCCE for it here:
https://github.com/kraklin/elm-format-nesting-bug-sscce
Current way around is to split those deeply nested lists into several functions once it exceeds cca 10 levels of nested lists.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the deeply nested-list case from the linked SSCCE with elm-format and compare it with the reported 500-line input. No repository file or test is named in the issue, so locate the formatter entry point and profile the slowdown. Done means deeply nested lists no longer show exponential performance degradation and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elm, haskell
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100