
#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