M. Edward (Ed) Borasky
9/24/2007 2:26:00 PM
Chad Perrin wrote:
> On Mon, Sep 24, 2007 at 02:21:34PM +0900, M. Edward (Ed) Borasky wrote:
>> Felix Windt wrote:
>>> I'm curious whether 4.2 would give further performance enhancements - maybe
>>> if I have some time this week I'll build a tool chain to test with.
>> It's unlikely to be faster in a statistically significant sense. As a
>> matter of fact, in many cases the *older* gcc versions give faster code!
>> Poke around on Anton Ertl's Forth/VMgen site and you'll find that *his*
>> performance hit a peak with gcc 2.95 and has been dropping steadily with
>> each new gcc since then. :)
>
> I find that rather surprising. The common wisdom seems to be that newer
> compiler versions tend to optimize more aggressively for the common case,
> and take longer to compile as a result -- but tend to cause problems for
> performance with multithreaded applications because until very recently
> that hasn't been a priority for most compilers. Falling performance for
> the same code on newer compiler versions makes me wonder what else is
> going on in compiler development. If you have any insights, I'd like to
> know about it.
The phenomenon is specific to gForth/vmgen and not a general rule as far
as I know. The "general rule" is that newer compilers do better on newer
architectures and "about the same" in the sense of statistical
significance on the older ones.
gForth/vmgen has some very specific dependencies on gcc itself -- it
uses some non-standard extensions to the C language in gcc and
aggressively goes for putting things in registers, something most
programmers wouldn't risk doing.
Another example is the ATLAS linear algebra library. Again, this is
highly tuned C code (and now even has some assembler kernels). GCC 3 was
significantly better than early versions of GCC 4 on 32-bit
architectures. I don't recall if GCC 4 is now equivalent, and the point
may be moot if the assembler kernels were introduced as a result.
> I wonder if Ruby 1.9 would compile with the TenDRA compiler. . . .
I've never heard of it. If I had an Intel Core2 chip, I'd evaluate the
Intel compiler on it, but I don't ... I'm an Intel-free zone. :)