This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Code speed
- To: gcc at gcc dot gnu dot org
- Subject: Code speed
- From: Jan Kroken <jankr at ifi dot uio dot no>
- Date: 07 Jun 2001 17:55:47 +0200
To test gcc 3.0's performance, I tried to compile gawk-3.1.0 with
different versions of gcc, and different flags, on a Pentium III
computer (linux-2.2.12,glibc-2.1.2).
The versions of gcc I have are gcc-2.95.2 (probably compiled with
gcc-2.95 or 2.95.1, I don't remember), and the gcc snapshot from
2001-06-04 (3.0), compiled withy gcc-2.95.2. All test runs of gawk are
run several times to avoid bad/good luck. In the list below, I have
included "representative" test runs.
I then tested the speed of the compiled gawk by runnign a simple
script on a log file of about 1.2 mb, with the time command.
in all cases, awk is compiled with
./configure --prefix=... ;make;make install
Here are the results:
CC=gcc-2.95.2, CFLAGS=
% time awk -f test.awk numberofproducts.log
110587
awk -f test.awk numberofproducts.log 0.62s user 0.03s system 101% cpu 0.640 total
CC=gcc-2.95.2, CFLAGS=-march=i686
% time /usr/test/march/bin/awk -f test.awk numberofproducts.log
110587
/usr/test/march/bin/awk -f test.awk numberofproducts.log 1.06s user 0.02s system 97% cpu 1.105 total
CC=gcc-2.95.2, CFLAGS=-march=i686 -O3
% time /usr/test/march_o3/bin/awk -f test.awk numberofproducts.log
110587
/usr/test/march_o3/bin/awk -f test.awk numberofproducts.log 0.67s user 0.04s system 106% cpu 0.666 total
CC=gcc-3.0, CFLAGS=
% time /usr/test/gcc3/bin/awk -f test.awk numberofproducts.log
110587
/usr/test/gcc3/bin/awk -f test.awk numberofproducts.log 0.90s user 0.02s system 106% cpu 0.867 total
CC=gcc-3.0, CFLAGS="-march=i686 -O3"
% time /usr/test/gcc3_march_o3/bin/awk -f test.awk numberofproducts.log
110587
/usr/test/gcc3_march_o3/bin/awk -f test.awk numberofproducts.log 0.79s user 0.04s system 108% cpu 0.765 total
AWK script:
BEGIN { N=0 ; }
/23/ { N=N+$3 ; }
END { print N ; }
Detailed system specification
% rpm -qa | grep glibc
glibc-2.1.2-11
glibc-devel-2.1.2-11
% more /proc/version
Linux version 2.2.12-20 (root@porky.devel.redhat.com) (gcc version egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)) #1 Mon Sep 27 10:40:35 EDT 1999
% more /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 7
model name : Pentium III (Katmai)
stepping : 3
cpu MHz : 599.938468
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
sep_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 3
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat p
se36 psn mmx osfxsr kni
bogomips : 598.02
--
-jk