haskell / haskell/pretty

Quadratic performance issues

Open
#32 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
75
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Try this:

```
import Text.PrettyPrint
import System.Environment
main = do
[ s ] <- getArgs
print $ iterate ( \ x -> fsep [ text "a" , x <+> text "b" ] ) empty !! read s
```

on my machine:

```
input | runtime in sec

100 | 0.1
200 | 1.1
300 | 4.4
400 | 11.4
```

This testcase is simplified from https://ghc.haskell.org/trac/ghc/ticket/7666
I think this bug (gut feeling - some quadratic behaviour) has been sitting there for a long time.
I do think this is serious. I think it also hurts haddock.

pretty-1.1.3.2 for ghc-8.0.0.20160111 and pretty-1.1.2.0 for ghc-7.10.3

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.