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

Formatting deeply nested lists is slow

Open ollef opened this issue 4 years ago • 0 comments

Formatting the following program takes a bit over 6 seconds on my machine:

x =
    [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]

If I add another nested list, it takes about 12 seconds:

x =
    [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]

This slowness showed up in real life code with HTML nested 14 or so levels deep.

ollef avatar Aug 19 '19 10:08 ollef