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

Reply via email to