[GHC] #5218: Add unpackCStringLen# to create Strings from string literals

GHC ghc-devs at haskell.org
Mon Aug 21 13:59:24 UTC 2017


#5218: Add unpackCStringLen# to create Strings from string literals
-------------------------------------+-------------------------------------
        Reporter:  tibbe             |                Owner:  thoughtpolice
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.0.3
      Resolution:                    |             Keywords:  strings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #5877 #10064      |  Differential Rev(s):  Phab:D2443
  #11312, #9719                      |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 > These are statically allocated literals. I have a hard time believing
 that a one-word increase in binary size for each string literal will make
 a noticeable difference to GHC's binary sizes.

 Okay, I ran a quick experiment, compiling GHC with `-ddump-simpl` and
 grepping for primitive strings in the result. The result is merely ~30000
 string literals. As I said earlier, a good fraction of these are short, so
 the relative change in space needed by string literals is rather large.
 However, compared to the rest of the program, it's quite small: each
 literal blowing up by a word would be around 250kB.

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


More information about the ghc-tickets mailing list