[Nottingham] The quickest distro in NLUG

Martin Garton martin at stupids.org
Thu Sep 14 22:24:59 BST 2006


On Thu, 2006-09-14 at 20:35 +0100, Martin wrote:

> Has anyone compared the pros/cons of -O2 or -O3 vs -Os?
> 
> (Compiler optimisations for speed vs optimise for smallest code.)

Obviously you can get the benefit of smaller code using -Os if that's
your goal.

You can get the benefit of faster running code using one of the above
depending on various things. (cpu cache size, ram size and possibly
other things)

On any given architecture, I believe -O3 tends to produce faster code
than -O2 (but not always, despite what one might expect) but where -Os
fits in performance-wise seems unpredictable to me although I haven't
done much more than very basic (and probably flawed) tests.

I've read conflicting reports about whether -Os is a good general
purpose default.

-- 
Martin.





More information about the Nottingham mailing list