[GHC] #14161: Performance Problems on AST Dump
GHC
ghc-devs at haskell.org
Mon Aug 28 07:07:10 UTC 2017
#14161: Performance Problems on AST Dump
-------------------------------------+-------------------------------------
Reporter: h4ck3rm1k3 | Owner: dfeuer
Type: bug | Status: new
Priority: low | Milestone: 8.2.2
Component: Compiler | Version: 8.3
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64
Type of failure: Compile-time | (amd64)
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by dfeuer):
Actually, that's only one piece of the puzzle. Another major problem is
that when `showAstData` is called in `HscMain`, its (`String`) result is
converted to an `SDoc` using `text`. In order to even think about
rendering that result, `Pretty` calculates its length. This forces the
entire dump to be built in memory as a `String`. I don't have enough
memory to do that on my system!
I'm working on a patch to make `showAstData` produce a `Doc` right from
the start rather than a `String`. Initial experiments suggest that this
has a much better chance of working. One question: when should one produce
a `Doc` and when should one produce an `SDoc`? I'm pretty unclear on that
bit.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14161#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list