elm-format icon indicating copy to clipboard operation
elm-format copied to clipboard

Performance drops exponentially with deeply nested lists

Open kraklin opened this issue 3 years ago • 2 comments

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.

kraklin avatar Nov 21 '22 16:11 kraklin

Can you confirm which version of elm-format you're using, so make sure you're not seeing https://github.com/avh4/elm-format/issues/642 ?

Side-note that this might be similar to https://github.com/avh4/elm-format/issues/753

avh4 avatar Nov 21 '22 19:11 avh4

Latest version - 0.8.5 it is fixed in the elm-tooling in the SSCCE repository.

Regarding the other problems - this is replicable with lists of one element containing list of one element... so I'd say the length of the list or size of the file does not play any role with this one.

kraklin avatar Nov 21 '22 19:11 kraklin