This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj's IO performance vs blackdown JDK
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: tromey at redhat dot com, Christopher Marshall <christopherlmarshall at yahoo dot com>, Bryce McKinlay <bryce at mckinlay dot net dot nz>, java at gcc dot gnu dot org, per at bothner dot net
- Date: Fri, 26 Dec 2003 21:32:40 -0600
- Subject: Re: gcj's IO performance vs blackdown JDK
- Reply-to: gnustuff at thisiscool dot com
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