[GHC] #12900: Common up identical info tables
GHC
ghc-devs at haskell.org
Wed Nov 30 09:30:28 UTC 2016
#12900: Common up identical info tables
-------------------------------------+-------------------------------------
Reporter: dobenour | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Runtime | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Why do you say "massive" amount of space? Do you have data? My guess
would be that, except in pathological situation (e.g. thousands of
identical data types) the saving would be vanishingly small.
Also I think that info tables contain strings that identify the type for
debuggers etc; ghci has such a debugger built in. You'd lose this
entirely.
So I'm a skeptical that the gain justifies the pain (implementation
complexity, loss of functionality). But data might convince!
If you are looking for code space saving, then I think a more profitable
place might be commoning up bits of Cmm code. E.g. consider
{{{
f x y = case x of True -> False; False -> y
}}}
We push a return address, evaluate `x`; when we come back we take a
conditional jump based on the tag and, in the `True` case we just return a
fixed constructor `False`. Lots of code just returns `False`! If all
that code was commoned up, we might get a big space saving. Maybe there
are some sequences that are SO common we can put them in a big library,
always available in the RTS, so all libraries could share.
We'd need automation to find these common sequences and see which ones
happened a lot.
I remember a PhD student trying this years ago (20 yrs?) with some
success.
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12900#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list