This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Extremely bad performance compiling bzip2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]