This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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] for Review: BufferedReader and InputStreamReader Optimizations


Hi Mohan,

I have read this post yesterday:
http://gcc.gnu.org/ml/java/2003-12/msg00213.html

I was wondering if you have made a test to something like this:

jint java::io::BufferedReader::lineEnd (jint limit)
{
  jchar *pbufbegin = elements (buffer);
  jchar *pbuf = pbufbegin + pos;
  jchar *pbufend = pbufbegin + limit;

  while ( pbuf < pbufend )
  {
    if ( *pbuf == '\n' || *pbuf == '\r')
      break;

    pbuf++;
  }
  return pbuf - pbufbegin;
}

I am just curious about the probable optimization (made by g++) to your source code. I guess that we should see a similar time here (if not, I would like to know why).

Thanks,
João


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