Re: The Kommunity vs. Dick Johnson

Richard B. Johnson (root@chaos.analogic.com)
Tue, 17 Nov 1998 08:56:33 -0500 (EST)


On Mon, 16 Nov 1998, Marc Lehmann wrote:

> 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 think you just must take your 'C' version and include it in the kernel
immediately. It has somehow been able to do all that work with fewer
instructions than data acted upon!

> 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:
>

Loop unrolling increases code size, that's all. If the performance
increase is worth it, you do loop unrolling.

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

The benchmark produces the correct results. It therefore can't be
bad.

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

I refuse to get into a Holy War about using one tool or another. Tools
are tools. The Linux kernel checksum routine(s) are already written
in assembly. The fact that the file-name ends in '.c' means nothing.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.127 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
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/