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: gcj's IO performance vs blackdown JDK


Hi Andrew,

>Try this instead it should give you even more.

Here is the output from three successive runs of the "old" version
vs. yours, with the JDK output included each time for reference.
I think the timings are essentially the same, but your version could
be slightly faster....

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/

1. pos <= i < limit
-------------------------8<-------------------------
jint java::io::BufferedReader::lineEnd (jint limit)
{
  jchar *pbuf = elements (buffer);
  int i = pos;
  for (; i < limit; i++)
  {
    jchar ch = pbuf[i];
    if (ch == '\n' || ch == '\r')
      break;
  }
  return i;
}
-------------------------8<-------------------------

          GCJ (1)      JRE
        ---------   ---------
user    0m14.506s   0m15.549s
user    0m14.531s   0m15.584s
user    0m14.527s   0m15.566s


2. 0 <= i < limit - pos
-------------------------8<-------------------------
jint java::io::BufferedReader::lineEnd (jint limit)
{
  jchar *pbuf = elements (buffer) + pos;
  int i = 0;
  limit -= pos;
  for (; i < limit; i++)
  {
    jchar ch = pbuf[i];
    if (ch == '\n' || ch == '\r')
      break;
  }
  return i+pos;
}
-------------------------8<-------------------------

          GCJ (2)      JRE
        ---------   ---------
user    0m14.508s   0m15.645s
user    0m14.479s   0m15.637s
user    0m14.545s   0m15.574s




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