Re: faster strcpy()

Ion Badulescu (ionut@moisil.cs.columbia.edu)
Sun, 26 Apr 1998 21:30:22 -0400 (EDT)


In article <Pine.LNX.3.95.980426201553.3174A-100000@chaos.analogic.com> you wrote:
> For all those who are so sure of themselves:

[code snipped]

> # gcc -O2 -o xxx xxx.c
> # xxx
> Length = 4095
> Normal strcpy() Count = 32504
> Strange strcpy() Count = 15352
> Length = 4031
> Normal strcpy() Count = 32495
> Strange strcpy() Count = 15733
> Length = 3967
> Normal strcpy() Count = 33089
> Strange strcpy() Count = 15831
> Length = 3903
> Normal strcpy() Count = 33883
> Strange strcpy() Count = 16072
> Length = 3839
> Normal strcpy() Count = 34473
> Strange strcpy() Count = 16506
> Length = 3775
> Normal strcpy() Count = 34723

Try again:

moisil:~/images$ gcc -O2 zzz.c
moisil:~/images$ ./a.out
Length = 4095
Normal strcpy() Count = 5233
Strange strcpy() Count = 13738
Length = 4031
Normal strcpy() Count = 5285
Strange strcpy() Count = 13834
Length = 3967
Normal strcpy() Count = 5348
Strange strcpy() Count = 13939
Length = 3903
Normal strcpy() Count = 5403
Strange strcpy() Count = 14370
Length = 3839
Normal strcpy() Count = 5612
Strange strcpy() Count = 14527

> # cat /proc/cpuinfo
> processor : 0
> cpu family : 6
> model : Pentium II (Klamath)
> vendor_id : GenuineIntel
> stepping : 3
> fdiv_bug : no
> hlt_bug : no
> sep_bug : no
> f00f_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid level : 2
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov mmx
> bogomips : 266.24
>
> processor : 1
> cpu family : 6
> model : Pentium II (Klamath)
> vendor_id : GenuineIntel
> stepping : 3
> fdiv_bug : no
> hlt_bug : no
> sep_bug : no
> f00f_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid level : 2
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov mmx
> bogomips : 266.24

moisil:~/images$ cat /proc/cpuinfo
processor : 0
cpu : 586
model : 4
clock_speed : 234 MHz
vendor_id : GenuineIntel
stepping : 3
fdiv_bug : no
hlt_bug : no
f00f_bug : yes
fpu : yes
fpu_exception : yes
cpuid : yes
wp : yes
flags : fpu vme de pse tsc msr mce cx8 mmx
bogomips : 466.94

> The 'C' library is glibc-2.0.5. Case closed.

libc 5.4.44 here, egcs 1.0.2 + pgcc extensions.

I don't think it's a closed case yet...

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu