This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Extremely bad performance compiling bzip2
- To: Andi Kleen <ak at muc dot de>
- Subject: Re: Extremely bad performance compiling bzip2
- From: Tobias Ringstrom <tori at prosolvia dot se>
- Date: Wed, 09 Dec 1998 09:53:23 +0100 (CET)
- Cc: egcs at cygnus dot com
- Organization: Prosolvia AB
On 09-Dec-98 Andi Kleen wrote:
> In muc.lists.egcs.misc, you wrote:
>>Have you tried bzip2 compiled with gcc 2.7.2.3 and linked to glibc 2?
>>I know if there are many getc/putc's in the code, glibc 2 can much
>>slower than libc 5.
>
> I am curious why. Does checking an uncongested lock really involve that
> much overhead?
I ran a quick test on my i686-pc-linux-gnu with glibc-2.0.7-13.rpm and got:
> time ./putchar_unlocked 100000000 > /dev/null
3.830u 0.010s 0:03.83 100.2% 0+0k 0+0io 65pf+0w
> time ./putchar 100000000 > /dev/null
16.160u 0.040s 0:16.20 100.0% 0+0k 0+0io 66pf+0w
The test program is running in a tight loop, printing spaces. Notice the
impressive CPU utilization of 100.2% :-)
/ Tobias