
#9345: Data.List.inits is extremely slow -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | 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: | -------------------------------------+------------------------------------- Comment (by nomeata):
I was finally able to figure out how to read that file, and wow. Those are some impressive results.
Of course the allocation and destruction of the `Queue` is not for free. Just to make sure I didn’t do anything stupid: Can you reproduce my results? If we are worried about `seq` we can simply inline my `myScanl'` in `initsQ2` and replace the `seq` by `case` statements. Or leave the `seq` but argue that we are always applying them to values of type `Queue`, nothing breaks. And by that argument, as long as `myScanl` is only used for `initsQ2`, we should be safe. I guess we only should worry about actually adding `scanl'` to the libraries, but that’s a different issue and should be discussed in #9356 I guess. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9345#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler