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


> > 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.


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