PATCH: powerpc/strchr.S for BPs
Greg McGary
greg@mcgary.org
Mon Jul 24 03:51:00 GMT 2000
Greg McGary <greg@mcgary.org> writes:
> Greg McGary <greg@mcgary.org> writes:
>
> > That puts the slow-down for pure strchr in the return-NULL case at approx 1%.
>
> Make that 10%.
I'm getting tired of answering my own emails, so let this be the last time! 8^)
Here's the original data:
> ./words-old 1: 0:09.77 real, 9.75 user, 0.02 sys, 99% CPU
> ./words-old 1: 0:09.85 real, 9.84 user, 0.01 sys, 99% CPU
> ./words-old 1: 0:09.83 real, 9.81 user, 0.02 sys, 100% CPU
> ./words-new 1: 0:10.51 real, 10.50 user, 0.02 sys, 100% CPU
> ./words-new 1: 0:10.50 real, 10.50 user, 0.00 sys, 99% CPU
> ./words-new 1: 0:10.50 real, 10.48 user, 0.02 sys, 99% CPU
> ./words-nul 1: 0:01.85 real, 1.84 user, 0.01 sys, 99% CPU
> ./words-nul 1: 0:01.85 real, 1.83 user, 0.02 sys, 99% CPU
> ./words-nul 1: 0:01.85 real, 1.84 user, 0.00 sys, 99% CPU
Exact slowdown is (newtime-overhead)/(oldtime-overhead) =
(10.5-1.85)/(9.80-1.85) = 1.08805031446540880503, or 8.8% extra runtime.
Geoff, it's still a micro-efficiency IMO since real programs don't
spend much time in strchr; but, if you insist, I'll rework strchr.S to
eliminate the extra branch.
Greg
More information about the Libc-hacker
mailing list