RE: Optimization beyond the Module Border

2008-03-21 Thread Simon Peyton-Jones
| 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'

Re: Optimization beyond the Module Border

2008-03-20 Thread Bernd Brassel
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

RE: Optimization beyond the Module Border

2008-03-20 Thread Simon Peyton-Jones
| 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

Re: Optimization beyond the Module Border

2008-03-20 Thread Ian Lynagh
On Thu, Mar 20, 2008 at 09:47:28AM +0100, Bernd Brassel wrote: compiled things with -O2 AND -prof -auto-all no profile would be written. This should work, for the reasons that you give. Did you use options like +RTS -p when running the program? If so, please give us an example to reproduce

RE: Optimization beyond the Module Border

2008-03-20 Thread Matthew Pocock
| 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,

Re: Optimization beyond the Module Border

2008-03-20 Thread Don Stewart
bbr: 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

Re: Optimization beyond the Module Border

2008-03-20 Thread Bernd Brassel
Don Stewart wrote: You almost always want to profile with full optimisations on. Otherwise its not even close to measuring the kind of code you're actually running. Ian Lynagh wrote: This should work, for the reasons that you give. Did you use options like +RTS -p when running the program?

Optimization beyond the Module Border

2008-03-19 Thread Bernd Brassel
Hi all, I have noticed that there is a great difference between optimizing modules separately and all at once, e.g., with -fforce-recomp. I have had examples factors up to 15 in run time (and even different behavior in context with unsafePerformIO). Is there any option that makes ghc write out

RE: Optimization beyond the Module Border

2008-03-19 Thread Simon Peyton-Jones
| I have noticed that there is a great difference between optimizing | modules separately and all at once, e.g., with -fforce-recomp. I have | had examples factors up to 15 in run time (and even different behavior | in context with unsafePerformIO). GHC does a lot of cross-module inlining

Re: Optimization beyond the Module Border

2008-03-19 Thread Bernd Brassel
Simon Peyton-Jones wrote: GHC does a lot of cross-module inlining already, and *does* write stuff into interface files, provided you use -O. I used -O4. Is that the bad thing? I'm always interested in performance differences of a factor of 15 though! Can you supply an example (as small

Re: Optimization beyond the Module Border

2008-03-19 Thread Don Stewart
bbr: Simon Peyton-Jones wrote: GHC does a lot of cross-module inlining already, and *does* write stuff into interface files, provided you use -O. I used -O4. Is that the bad thing? There's nothing about -O2 However, I think that's ok -- it clamps -ON | N2 to -O2 I'm always

Re: Optimization beyond the Module Border

2008-03-19 Thread Malcolm Wallace
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