Re: OT: Does Linux have any "Perfect Code"

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Eric Dumazet <dada1@...>
Cc: Russell Leighton <russ@...>, LKML <linux-kernel@...>
Date: Thursday, November 15, 2007 - 3:43 am

Eric Dumazet <dada1@cosmosbay.com> writes:

I would have expected 1997 compilers to already do these standard muliplication
optimizations. 


To be fair Linux runs on a lot of CPUs which are not quite as fast
at multiplying as an Opteron, especially not for 64bit multiplies.
So some optimizations might be still a good idea.  For divisions
at least Linux also actively does this.

On the other hand compilers also get worse. Modern gccs now turn

while (nsec >= NANOSEC) {
      nsec -= NANOSEC;
      sec++;
}

into a division which is actually much slower. Or insert unnecessary
cache misses randomly. See the recent gcc thread safety discussion
where it turned out that the thread breaking optimization is actually
more a general pessimization.

-Andi
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
OT: Does Linux have any "Perfect Code", Russell Leighton, (Wed Nov 14, 9:21 pm)
Re: OT: Does Linux have any "Perfect Code", Philippe Elie, (Thu Nov 15, 4:27 am)
Re: OT: Does Linux have any "Perfect Code", Michael Gerdau, (Thu Nov 15, 9:16 am)
Re: OT: Does Linux have any "Perfect Code", Chris Friesen, (Thu Nov 15, 1:05 pm)
Re: OT: Does Linux have any "Perfect Code", Daniel Barkalow, (Thu Nov 15, 11:10 am)
Re: OT: Does Linux have any "Perfect Code", Geert Uytterhoeven, (Sat Nov 17, 4:44 am)
Re: OT: Does Linux have any "Perfect Code", Eric Dumazet, (Thu Nov 15, 2:29 am)
Re: OT: Does Linux have any "Perfect Code", Andi Kleen, (Thu Nov 15, 3:43 am)
Re: OT: Does Linux have any "Perfect Code", David Miller, (Thu Nov 15, 3:11 am)
Re: OT: Does Linux have any "Perfect Code", David Miller, (Wed Nov 14, 9:33 pm)