This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Extremely bad performance compiling bzip2
- To: Ulrich Drepper <drepper at cygnus dot com>
- Subject: Re: Extremely bad performance compiling bzip2
- From: Osku Salerma <osku at iki dot fi>
- Date: Wed, 9 Dec 1998 17:19:07 +0200 (EET)
- cc: egcs at egcs dot cygnus dot com
> > BTW, why is it slower? Is glibc 2.1 any faster?
>
> If a program uses putc on a stream which has no problems with multiple
> threads it should use putc_unlocked. Similar functions variants exist
> for fputc, fputs etc.
I put these at the start of bzip2.c, but the running time only went
down about 5 seconds, to 47 seconds. (There weren't any places where
putc/getc instead of fputc/fgetc seemed likely to cause troubles.)
#define ferror(fp) ferror_unlocked(fp)
#define getc(fp) getc_unlocked(fp)
#define putc(a,fp) putc_unlocked(a,fp)
#define fputc(a,fp) putc_unlocked(a,fp)
#define fgetc(fp) getc_unlocked(fp)
--
Osku Salerma - osku@iki.fi - http://www.iki.fi/osku/
I'd give my right arm to be ambidextrous.