This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Speed up profile reading/writing
> On Thu, Feb 27, 2003 at 02:16:32AM +0100, Zdenek Dvorak wrote:
> > 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?
Apparently it does.
>From the straces we've seen it just made dozen of very small reads and
writes.
Honza
>
>
> r~