Optimization beyond the Module Border

Matthew Pocock matthew.pocock at ncl.ac.uk
Thu Mar 20 10:42:24 EDT 2008


> | > I'd be interested in any progress here -- we noticed issues with
> | > optimisations in the stream fusion package across module boundaries
> | > that we never tracked down. If there's some key things not firing,
> | > that would be good to know.
> |
> | I suspect that if all modules are compiled -O0, then you recompile one
> | module with -O2, high up in the dependency graph (i.e. it depends on
> | many lower-level modules), plus all things that in turn depend on it
> | (--make), you will not get the good performance you expect.  None of the
> | lower-level functions will have exported inlinings or fusion rules into
> | the interface file.  _All_ modules must be recompiled with -O2,
> | especially the bottom of the dependency chain, to get the best benefit
> | from optimisation.
>
> Absolutely correct.
>
> Should this be better documented?  If so, would someone like to think
> where in GHC's user manual they would have looked (or did look), and send
> me some text that would have helped them, had it been there?  As it were.
>
> Simon

Would it be possible for the compiler to say something like: "You are
applying level 2 optimization but some dependencies where compiled without
optimization enabled. To get full optimization, consider recompiling x,y,z
with -O2" - at least this would give us a fighting chance to 'fix' things.

Matthew

> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>




More information about the Glasgow-haskell-users mailing list