[GHC] #9676: Data.List.isSuffixOf can be very inefficient

GHC ghc-devs at haskell.org
Sat Oct 11 06:17:39 UTC 2014


#9676: Data.List.isSuffixOf can be very inefficient
-------------------------------------+-------------------------------------
       Reporter:  dfeuer             |                   Owner:  ekmett
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:  7.10.1
      Component:  Core Libraries     |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Easy (less than 1  |         Type of failure:  Runtime
  hour)                              |  performance bug
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 `Data.List.isSuffixOf` reverses both lists it is given. Thus, for example,
 {{{#!hs
 [12] `isSuffixOf` [1::Int .. (10^9)]
 }}}
 will build the complete list `[10^9, (10^9-1)..1]` in memory.

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


More information about the ghc-tickets mailing list