Re: Extremely poor performance crunching random numbers under PIV-FC5



webmaster@xxxxxxxxxxxxxx wrote:
Hi, I have installed Linux Fedora Core 5 (FC5) on a Pentium IV 3 Ghz, 4
Gb RAM, and SATA disk.

I have been detected CPU is running extremely slow on certain
situations: For example when doing random calculations. In order to
benchmark this particular situation I have writen an small C program
that make 10 million random numbers and measures the time consumed.

It is surprising that when the program is compiled with the static flag
enabled, it runs very fast, doing 10 million calculations in only 0.4
seconds. Nevertheless, when it is compiled without the static flag
(that is dynamic binary), the performance becomes very poor, consuming
40 seconds in doing it.

I have tested both compilations under other Linux distributions, like
Debian, and it runs in both case perfect, doing the job in only 0.4
seconds. I have also tested both programs under FC3 and I obtain the
same results than FC5. So I conclude that the problem only happens when
running Fedora!
If so, post to a fedora mailing list, they might have some ideas.
My results:

$ uname -a
Linux uqos.utelsystems.local 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 i686 i386 GNU/Linux
I've selinux disabled - it seems to cause all sorts of noise
and problems. Try disabling selinux and rerun.

$ ./static-test-cpu-2
Reservado 0.1 Gb de memoria en 0.000 sec
Escritura sobre 0.1 Gb de memoria en 3.840 sec
10 M de rand() en 1.580 sec (example.: 1913672895)
10 M de sqrt(i) en 3.490 sec (example.: 3162)
10 M de log(i) en 5.670 sec (example.: 16)
10 M de log10(i) en 5.970 sec (example.: 6)
LINUX: 10 M de random() en 1.550 sec (example.: 182036136)
LINUX: 10 M de lrand48() en 1.860 sec (example.: 771684145)

$ ./dynamic-test-cpu-2
Reservado 0.1 Gb de memoria en 0.000 sec
Escritura sobre 0.1 Gb de memoria en 3.830 sec
10 M de rand() en 1.990 sec (example.: 1412451083)
10 M de sqrt(i) en 3.470 sec (example.: 3162)
10 M de log(i) en 5.240 sec (example.: 16)
10 M de log10(i) en 5.370 sec (example.: 6)
LINUX: 10 M de random() en 1.680 sec (example.: 1521688479)
LINUX: 10 M de lrand48() en 2.380 sec (example.: 1357261858)
.