> A small program Main.hs compiled with -O runs 10 times faster or
> slower depending on the export list
> module Main (main)
> or module Main (main,test)
> Is this a bug?
I don't know without seeing the program. It's certainly extreme.
Can you send the code?
> Please, tell me, how to make -O work in ghc-2.08-i386-all-linux ?
> I am trying -O in Makefile for some critical modules of certain
> large project, but cannot predict when this occures useful.
I'm not sure what you mean by "how to make -O work". Just say "-O"
and your program should run faster. How much faster does depend a lot
on the program.
> In ghc-0.29 the performance for -O was predictable.
Aha! if you find a program where 0.29 makes a worthwhile improvement and
2.08 does not then please send it to us. That way we can fix the holes
in 2.08.
> May it help to build ghc from sources (not so simple for 20Mbyte RAM)
I doubt it.
> does it worth to set things like {-# inline 0 f #-} or
> {-# inline 1 f #-}
> - has ghc -c -O (2.08 or future) to be clever enough to guess
> what to inline?
It's worth it if you to be sure they'll be inlined.
Simon