floskell icon indicating copy to clipboard operation
floskell copied to clipboard

Significant runtime blowup when formatting pattern guards

Open Philonous opened this issue 4 years ago • 0 comments

Floskell takes 6s on my machine to reformat the following code fragment:

foo x | Just x1 <- Just x
      , Just x2 <- Just x1
      , Just x3 <- Just x2
      , Just x4 <- Just x3
      , Just x5 <- Just x4
      , Just x6 <- Just x5
      , Just x7 <- Just x6
      = True
  • On my production code it takes up to 4 minutes for 20 lines.
  • Removing one of the pattern guards makes it complete instantly
  • Removing floskell.json and using the implicit or an empty configuration makes it complete instantly
  • The smallest floskell.json I can reproduce this with is { "style": "cramer" }; I have not tried to find the individual option from the style that causes this
  • I'm running floskell 0.10.5

Philonous avatar Nov 30 '21 13:11 Philonous