[GHC] #9577: String literals are wasting space

GHC ghc-devs at haskell.org
Wed Sep 24 19:00:34 UTC 2014


#9577: String literals are wasting space
-------------------------------------+-------------------------------------
              Reporter:  xnyhps      |            Owner:  xnyhps
                  Type:  bug         |           Status:  new
              Priority:  low         |        Milestone:
             Component:  Compiler    |          Version:  7.8.2
  (NCG)                              |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Runtime     |  Related Tickets:
  performance bug                    |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Replying to [comment:12 rwbarton]:

 > I think this is easy to do as far as the linker side of things is
 concerned (just put the exceptional strings in their own section); the
 only bit that might be tricky is identifying which string literals should
 be considered exceptional and plumbing that information through the
 compiler.

 I think identifying them shouldn't be too hard (in enough cases to be
 useful)—they're not exported and they appear only as arguments to `error`
 or possibly other exception-raising functions. I say possibly because I
 imagine there may be situations where exceptions that carry strings may
 need to be handled quickly. I imagine, however, that in those cases the
 strings themselves may not be inspected. Another thought is that there's
 probably an open source or public domain block compression algorithm that
 can fit in a few hundred bytes of slow assembly to access a compressed
 error string region. Such a thing should of course be optional if we
 decide to do it.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9577#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list