[Haskell-cafe] -O2 compile option can give speed increase over -O. Fasta shootout program test runs.

Isaac Dupree isaacdupree at charter.net
Tue Jul 17 09:55:59 EDT 2007


Derek Elkins wrote:
> Just to add as this was not addressed. -O2 -does not- turn off bounds
> checking or any other obvious safety mechanism.

although even just -O removes GHC's special 'assert'ions (unless you 
explicitly keep them on?) -- though they shouldn't be used in such a way 
that they could trigger, assuming that the code/library that employs 
them is non-buggy (or exports 'unsafe' things in which case a library's 
client also has to be non-buggy).  Bounds checking is turned off iff you 
use functions named like unsafeAt, regardless of -O0, -O2 or any other 
optimization flags :)

Isaac


More information about the Haskell-Cafe mailing list