GHC lazy eval optimization bug

Simon Peyton-Jones simonpj at microsoft.com
Tue Feb 5 04:32:05 EST 2008


| Thank you for the explanation.  Inlining does explain the behavior I
| was seeing, and -fno-state-hack does make the program behave the way
| I'd expect.
|
| I would like to humbly submit that perhaps this optimization should be
| off by default.

I agree that the current behaviour sometimes bites badly, as it did for you here.  Trouble is, removing the hack has (or used to have) a significant negative effect on performance of lots of programs.

Still, I think that there are various other possibilities to try.  For example, compiling the I/O libraries (only) with the state-hack on, and with it off by default elsewhere, might gather most of the benefits without the costs.  Or restricting it to top level functions.  Or something like that.

It needs someone who's willing to do some measurements and try variations.  We can make suggestions about things to try.  Meanwhile, I'll tack these remarks onto http://hackage.haskell.org/trac/ghc/ticket/1168

Thanks for bringing this up.

Simon



More information about the Glasgow-haskell-users mailing list