[GHC] #15113: Do not make CAFs from literal strings
GHC
ghc-devs at haskell.org
Sun Sep 30 13:48:27 UTC 2018
#15113: Do not make CAFs from literal strings
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.2.2
Resolution: | Keywords: CAFs
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4717
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by osa1):
I started looking into this, but I realized that nofib can't be run with
GHC 8.6 (and probably with HEAD) so I'll need to fix nofib first.
What I've done so far is I implemented two counters:
- A runtime counter for SRT traversals done by the GC
- A compiler counter to count how many SRTs are generated (I'm also
recording sum of sizes of the SRTs although this is probably not too
useful)
The runtime counter is printed with `+RTS -t`:
{{{
<<ghc: 98529880 bytes, 63 GCs, 3481032/7949096 avg/max bytes residency (6
samples), 20M in use, 0.000 INIT (0.000 elapsed), 0.038 MUT (0.198
elapsed), 0.059 GC (0.059 elapsed), 226752 SRT scavs :ghc>>
}}}
The "226752 SRT scavs" part is new, and it means that we scavenged 226752
SRTs.
The compiler counter prints once per binding group and it looks like this:
{{{
SRTs: 4 SRT(s), total size: 17
}}}
This means that 4 SRTs are generated, and total size of all those SRTs are
17 words.
The patch is here:
https://github.com/osa1/ghc/commit/c46fe24a02591edd3ce7b6aa70246493826d218d
I'll fix nofib first and then try to collect these numbers from nofib
output.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15113#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list