Opened 10 years ago

Closed 8 years ago

#3737 closed bug (fixed)

inlining happens on foldl1 and does not happen on direct application of combinator

Reported by: guest Owned by:
Priority: normal Milestone: 7.2.1
Component: Compiler Version: 6.10.4
Keywords: Cc: ghc@…
Operating System: Linux Architecture: x86
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This is certainly related to #3736.

The code can be found at:

Look into functions mainChunky1MixFold and mainChunky1MixFlat. The first one does

foldl1 mixVec $ map (uncurry tone0) $ [(f0,p0), (f1,p1), (f2,p2)]

and generator0Freq gets inlined and is fast. (1.4 seconds) The second one does

tone0 f0 p0 `mixVec` tone0 f1 p1 `mixVec` tone0 f2 p2

and generator0Freq is not inlined and this is slower (2.0 seconds). (Inlining or specialising mixVec doesn't change the numbers. I tried that because I first thought, mixVec would be the problem.)

But we cannot derive from it, that using 'foldl1' is better in general. Since if you compare mainMonolithic1GeneratorFold with mainMonolithic1Generator, you find that the fold version is slower (2.8 seconds vs. 2.0 seconds).

Attachments (1)

SpeedTestChorus.hs (12.2 KB) - added by guest 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by guest

Attachment: SpeedTestChorus.hs added

comment:1 Changed 10 years ago by simonpj

Same difficulty as with #3736; can't reproduce.


comment:2 Changed 10 years ago by igloo

Milestone: 6.14.1

comment:3 Changed 10 years ago by simonpj

I hope this may be fixed by the same fix as #3736. Could you try?


comment:4 Changed 9 years ago by igloo


comment:5 Changed 9 years ago by igloo


comment:6 Changed 8 years ago by igloo

Resolution: fixed
Status: newclosed

Hopefully fixed, and no response from submitter, so closing.

Note: See TracTickets for help on using tickets.