[Vm-dev] Compiler Optimization in the different CMakeConfigs
eliot.miranda at gmail.com
Wed Apr 20 19:30:22 UTC 2011
On Tue, Apr 19, 2011 at 2:13 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:
> Hi guys. Unix and Windows confs have -O2. However, in Mac, the Carbon ones
> have -O3 y the cocoa ones -Os.
> As far as I know -Os is for size, so we really don't care about that
> (unless we are in a mobile device). So, is there a reason why Unix and
> Windows use -O2 and Mac -O3 ? should we chage this? which should we use?
Use what works based on testing and field experience. I expect everything
is there for a reason. IIABDFI (if it ain't broke don't fix it). If you can
produce a comprehensive stress test then you can experiment with different
optimization levels. If you can't you're on thin ice changing them.
Further, at least in Cog the speed of the VM (as opposed to plugins) is much
less dependent on the level of compiler optimization used since that has no
effect on the code the Cogit generates. BTW, often -Os gets good speed
since compact code can often be fast code, at least in systems without huge
inner loops where there's little opportunity for loop-unrolling and inlining
to make much difference. Bloated code can have poor cache performance. On
current processors, hugely fast relative to memory speed, unless you're
talking about media streaming algorithms inlining and loop unrolling is a
dubious optimization to apply. hence I would stick with -Os or -O2 for the
core VM and choose more aggressive settings for selected plugins.
hope this makes sense
> Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev