[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [RFC] diff-optimizations-bytes branch: avoiding function call overhead (?)

From: Stefan Fuhrmann <eqfox_at_web.de>
Date: Wed, 15 Dec 2010 10:58:35 +0100

On 15.12.2010 02:30, Stefan Fuhrmann wrote:
> On 14.12.2010 23:35, Johan Corveleyn wrote:
>
>> Thoughts?
> Two things you might try:
> * introduce a local variable for afile[i]
> * replace the for() loop with two nested ones, keeping
> calls to other functions out of the hot spot:
>
> for (i=0; i < file_len;)
That should read:
for (i=0; i < file_len; i++)
> {
> /* hot spot: */
> for(; i < file_len; i++)
> {
> curFile = afile[i];
> if (curFile->chunk==-1)
> curFile->chunk = 0;
> else if (curFile->curp != curFile->endp -1)
> curFile->curp++;
> else
> break;
> }
>
> if (i < file_len)
> {
> /* the complex, rarely used stuff goes here */
> }
> }

-- Stefan^2
Received on 2010-12-15 10:59:20 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.