From: Juergen Strobel Date: 2006-06-06T07:00:37+09:00 Subject: Re: How to Improve Performance Now. Re: Zed and Luis drop the bombonRuby's poor performance On Wed, May 31, 2006 at 01:53:09AM +0900, Thomas Kirchner wrote: > * On May 30 14:07, Jon Smirl (ruby-talk@ruby-lang.org) wrote: > > Experiments done with the Linux kernel show -Os (optimize for size) > > runs faster than -O3. The Os code is smaller and more of it can fit in > > the CPU cache. The cost of cache misses out weighs the benefits of O3 > > optimizations. > > This heavily depends on the type of CPU you have, though. Different > processors have different cache sizes, and different compiler flags will > benefit different processors... differently! > > -Os might be better on older processors with smaller caches, and -O2 (and > sometimes -O3) might be better on newer processors that can cache the > bigger binaries. You should really do your own testing rather than going > by vague experimental results. > > Tom > The gcc devs are quite smart. If they say only -O and -O2 gives generally useful optimizations, with the later one giving all optimizations that don't have space tradeoffs, I won't argue. Everything higher is deemed more harmful than useful in the general case, and I don't want differently compiled versions of ruby on my system. Why? Because I think my time is better spent tackling architectural problems (like better caching) than squeezing some cycles from tight loops or memory management. It is easier to profile and measure. If you think you can contribute to ruby's performance this way, maybe start with a meaningful benchmark first? If people had a tool to measure the impact of compile time flags, and saw a big difference, that might get people working on this and memory alignment optimization too. J�rgen -- The box said it requires Windows 95 or better so I installed Linux