Re: The Kommunity vs. Dick Johnson

Marc Lehmann (pcg@goof.com)
Mon, 16 Nov 1998 22:23:33 +0100


On Sun, Nov 15, 1998 at 09:38:41PM -0500, Rick Hohensee wrote:
> I did some poking at Dick Johnson's asm for a checksum routine vs.
> what gcc produces. I compared his hand

Actually, I get:

Verifying ASM code
Counting C loops for 2 seconds
Counting ASM loops for 2 seconds
C routine : 310197
AS routine : 577433
Change : 1.86 times faster

with -O6 (pgcc), and

Verifying ASM code
Counting C loops for 2 seconds
Counting ASM loops for 2 seconds
C routine : 1079683
AS routine : 578192
Change : 0.54 times faster

with -O6 -funroll-all-loops. Thus the C version is about twice as fast.
(measured on a p-ii 333)

I don't want to talk about the effects that loop unrolling would have to the
kernel (the worst!), but I hope that this result reminds people that:

- this benchmark is bad bad bad, and IMHO has NO value at all

- hand-crafted assembly code isn't always "better" just because its
assembly

I haven't checked wether there is a problem with his timing method, but it
doesn't look broken to me.

-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/