[GHC] #12129: Optimize the implementation of minusInteger in the integer-gmp package

GHC ghc-devs at haskell.org
Sun May 29 06:02:47 UTC 2016


#12129: Optimize the implementation of minusInteger in the integer-gmp package
-------------------------------------+-------------------------------------
           Reporter:  admock         |             Owner:
               Type:  task           |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  libraries      |           Version:  8.0.1
  (other)                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Runtime
  Unknown/Multiple                   |  performance bug
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 As mentioned in [https://www.fpcomplete.com/blog/2016/05/weigh-package],
 the current implementation of `minusInteger` is
 {{{#!hs
 minusInteger x y = inline plusInteger x (inline negateInteger y)
 }}}
 which always allocates an additional integer.  This could be improved by
 not always calling `negateInteger` and instead having an implementation
 more like `plusInteger`'s.

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


More information about the ghc-tickets mailing list