[GHC] #9345: Data.List.inits is extremely slow

GHC ghc-devs at haskell.org
Sun Aug 31 17:42:47 UTC 2014


#9345: Data.List.inits is extremely slow
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  bug         |           Status:  patch
              Priority:  high        |        Milestone:  7.8.4
             Component:              |          Version:  7.8.3
  libraries/base                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Easy (less than 1
  Unknown/Multiple                   |  hour)
       Type of failure:  Runtime     |       Blocked By:
  performance bug                    |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by dfeuer):

 * status:  new => patch


Comment:

 My testing indicates that for large lists (e.g., 10,000 elements), Bertram
 Felgenhauer's simple and mostly very clean `initsT'` implementation is
 much better than any variation on `initsQ` when concatenating the results.
 I wrapped it up in `build` to get a ''little'' fusion potential (not
 essential) and uploaded a patch. I would still like very much to
 understand why using `take'` gives slightly better performance than using
 `take`, but it very clearly does.

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


More information about the ghc-tickets mailing list