[GHC] #14741: High-memory usage during compilation using Template Haskell

GHC ghc-devs at haskell.org
Sat Mar 9 07:08:28 UTC 2019


#14741: High-memory usage during compilation using Template Haskell
-------------------------------------+-------------------------------------
        Reporter:  donatello         |                Owner:  sighingnow
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.4
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #16190            |  Differential Rev(s):  Phab:D4384,
       Wiki Page:                    |  https://gitlab.haskell.org/ghc/ghc/merge_requests/141
-------------------------------------+-------------------------------------

Comment (by Marge Bot <ben+marge-bot@…>):

 In [changeset:"224a6b864c6aa0d851fcbf79469e5702b1116dbc/ghc"
 224a6b86/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="224a6b864c6aa0d851fcbf79469e5702b1116dbc"
 TH: support raw bytes literals (#14741)

 GHC represents String literals as ByteString internally for efficiency
 reasons. However, until now it wasn't possible to efficiently create
 large string literals with TH (e.g. to embed a file in a binary, cf
 #14741):
 TH code had to unpack the bytes into a [Word8] that GHC then had to re-
 pack
 into a ByteString.

 This patch adds the possibility to efficiently create a "string" literal
 from raw bytes. We get the following compile times for different sizes
 of TH created literals:

 || Size || Before || After  || Gain ||
 || 30K  || 2.307s || 2.299  || 0%   ||
 || 3M   || 3.073s || 2.400s || 21%  ||
 || 30M  || 8.517s || 3.390s || 60%  ||

 Ticket #14741 can be fixed if the original code uses this new TH feature.
 }}}

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


More information about the ghc-tickets mailing list