[GHC] #8647: Reduce allocations in `integer-gmp`

GHC ghc-devs at haskell.org
Wed Jan 8 23:26:29 UTC 2014


#8647: Reduce allocations in `integer-gmp`
--------------------------------------------+------------------------------
        Reporter:  hvr                      |            Owner:
            Type:  task                     |           Status:  patch
        Priority:  normal                   |        Milestone:  7.8.1
       Component:  libraries (other)        |          Version:  7.6.3
      Resolution:                           |         Keywords:  integer-
Operating System:  Unknown/Multiple         |  gmp
 Type of failure:  Runtime performance bug  |     Architecture:  x86_64
       Test Case:                           |  (amd64)
        Blocking:                           |       Difficulty:  Unknown
                                            |       Blocked By:
                                            |  Related Tickets:  #8638
--------------------------------------------+------------------------------

Comment (by Herbert Valerio Riedel <hvr@…>):

 In [changeset:"af2ba9c81cf6a3223ccc74c5aa17de18138fd824/integer-gmp"]:
 {{{
 #!CommitTicketReference repository="integer-gmp"
 revision="af2ba9c81cf6a3223ccc74c5aa17de18138fd824"
 Wrap `gmpz_tdiv_{q,r,qr}_ui` to optimize `quot`/`rem`

 This is useful as `quot`/`rem` are often used with small-int divisors,
 like when computing the digits of an `Integer`. This optimization
 reduces allocations in the following `nofib` benchmarks:

       Program        Size    Allocs   Runtime   Elapsed  TotalMem
    -----------------------------------------------------------------
         power       +0.3%     -0.8%     -1.2%     -1.2%     +0.0%
     primetest       +0.3%     -3.9%      0.07      0.07     +0.0%
           rsa       +0.3%     -4.0%      0.02      0.02     +0.0%
        symalg       +0.2%     -1.4%      0.01      0.01     +0.0%

 This addresses #8647

 Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
 }}}

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


More information about the ghc-tickets mailing list