[GHC] #8766: length [Integer] is twice as slow but length [Int] is 10 times faster

GHC ghc-devs at haskell.org
Fri Feb 14 10:17:00 UTC 2014


#8766: length [Integer] is twice as slow but length [Int] is 10 times faster
--------------------------------------------+------------------------------
        Reporter:  George                   |            Owner:  nomeata
            Type:  bug                      |           Status:  new
        Priority:  normal                   |        Milestone:  7.8.1
       Component:  Compiler                 |          Version:  7.8.1-rc1
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by Joachim Breitner <mail@…>):

 In [changeset:"a60eeccf06c28bee3b87c561450320d17c7399e3/base"]:
 {{{
 #!CommitTicketReference repository="base"
 revision="a60eeccf06c28bee3b87c561450320d17c7399e3"
 Improve list fusion for [n::Integer..m]

 enumFromTo for Integers goes via enumDeltaToInteger, which is less
 efficient, as the "delta > = 0" check prevents more inlining which is
 required for good fusion code. This rule avoids tihs check for the
 common case of "delta = 1", makes up_fb visible and hence inlineable,
 which greatly improves "length [n:Integer..m]"; even more so with
 CallArity enabled. (#8766)
 }}}

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


More information about the ghc-tickets mailing list