This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [cp-patches] [Patch] Improve/fix gnu.java.net.LineInputStream...
- From: Tom Tromey <tromey at redhat dot com>
- To: Chris Burdess <dog at bluezoo dot org>
- Cc: David Daney <ddaney at avtrex dot com>, classpath-patches at gnu dot org, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 13 Sep 2005 11:24:05 -0600
- Subject: Re: [cp-patches] [Patch] Improve/fix gnu.java.net.LineInputStream...
- References: <4325D839.80500@avtrex.com><82afe63528c3f2aa3c1c7dacb0f94bad@bluezoo.org>
- Reply-to: tromey at redhat dot com
>>>>> "Chris" == Chris Burdess <dog@bluezoo.org> writes:
>> I did take the liberty of adding my own micro-optimization, in that
>> if the encoding is US-ASCII, we can skip using String's character
>> encoding system and just request hibyte of 0. I did this because a
>> year ago with libgcj-3.4.3 we were seeing a vast increase in speed
>> doing this in a different situation.
Chris> This micro-optimisation should be applied to
Chris> ByteArrayOutputStream.toString, not here.
I agree with this approach.
However, I'm not sure this optimization is correct. Strictly
speaking, we may see a byte >= 0x80, which is not ASCII. Will the
ASCII converter turn this into '?'? (I forget what happens here ... I
know Sun has been a bit lax about ASCII handling in some areas,
treating it as identical to 8859-1.)
Tom