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

GHC ghc-devs at haskell.org
Mon Sep 1 22:19:04 UTC 2014


#9345: Data.List.inits is extremely slow
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  bug         |           Status:  new
              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:              |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Replying to [comment:26 nomeata]:
 > > This doesn't seem to affect the problem, however.
 >
 > Yes, I don’t think the problem in this particular case lies with `init`
 per se. I think it’s more like `concat`, but only when part of the
 recursion (the `c` above) is not inlined. That might also be what you
 observe.

 I hope you'll be able to tease this apart; `inits` isn't very important in
 the grand scheme of things, but `concat` is.


 > > I am curious if there is a way to manually force whatever's getting
 the wrong arity to get the right one
 >
 > Not with list fusion as we have it right now, I think. It should work
 with https://github.com/takano-akio/ww-fusion (which I should follow up on
 again).

 That looks very interesting, by which I mean I couldn't understand it at
 all the first time around. I'll have to try again. If it can really solve
 this class of problem in a fairly thorough fashion, it will certainly be
 worth the added complexity.

 > I wonder if maybe the rule for `concat` can be rewritten so that the
 resulting recursion is nicer, but I don’t see it right now (but I’m too
 jetlagged to think anyways).

 Rest well!

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


More information about the ghc-tickets mailing list