[GHC] #9577: String literals are wasting space

GHC ghc-devs at haskell.org
Thu Sep 25 08:54:30 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 xnyhps):

 Replying to [comment:15 carter]:
 > One question I've got about this whole thread is this:
 > What would this improve? I'm trying to understand how this will impact
 application performance or binary sizes (though i understand the latter is
 defnitely neglible)

 I think the performance loss for `[Char]`-strings is negligible: sharing
 means they are going to be unpacked just once, that's not worthy
 optimizing performance for. After unpacking the literal is never used
 again.

 `ByteString`s may have noticeable impact. Prepending a `ByteString`
 literal onto another `ByteString` involves a `memcpy` of the literal
 string. There might be code out there that does it millions of times.

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


More information about the ghc-tickets mailing list