This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Speed up profile reading/writing


Hello,

> > the linux kernel does not cope well with a lot of small reads and writes
> > produced by the profiling code. This gets significant if instrumented
> > program is large and runs for only small amount of time -- profiling
> > gcc spends about 50% of time in system when compiling testsuite during
> > profiledbootstrap. This patch makes the program to read/write the whole
> > .da files at once, thus improving speed in this case (admitedly
> > patological one) by about 30%.
> 
> Given that we're using stdio already, isn't all this equivalent
> to calling setvbuf(file, buf, _IOFBF, large)?  Or does fseek for
> some reason flush the input buffer?

seems like good idea; I will check whether it helps. The overhead of
glibc still might be higher than my solution, but it definitely would
be much nicer if it worked.

Zdenek


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