Re: faster strcpy()

Richard B. Johnson (root@chaos.analogic.com)
Mon, 27 Apr 1998 00:33:06 -0400 (EDT)


On Sun, 26 Apr 1998, Andrew Kieschnick wrote:

>
> On Sun, 26 Apr 1998, Richard B. Johnson wrote:
>
> > It would be interesting to determine if it's due to a cache that isn't
> > a cache at all. On three machines here, all pentiums, strange is
> > slower.
>
> I'm quite sure the pentium I tested does indeed have a real cache. We have
> a whole bunch of identical pentium-133 machines, and they all act the same
> - strange is faster.
>
> later,
> Andrew Kieschnick
>

I have a 486/DX-66 at home and I just tried it on that machine:

Length = 4095
Normal strcpy() Count = 1339
Strange strcpy() Count = 1998
Length = 4031
Normal strcpy() Count = 1308
Strange strcpy() Count = 1965
Length = 3967
Normal strcpy() Count = 1285
Strange strcpy() Count = 1998

On that machine 'strange' is faster. This would, to me, point out a
cache-stall problem.

I can disable the cache on that machine. When I do, I get:

Length = 4095
Normal strcpy() Count = 631
Strange strcpy() Count = 311
Length = 4031
Normal strcpy() Count = 667
Strange strcpy() Count = 314
Length = 3967
Normal strcpy() Count = 671
Strange strcpy() Count = 329

The performance is absymal, it took soooooo long to boot. However,
the benchmark now runs as expected.

FYI BogoMips is 33.17 on that machine. It didn't change when
I disabled the cache. The BIOS doesn't tell me _which_ cache I
disabled!

Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.92 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