DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11945>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11945

Too much memory and time spent parsing large message





------- Additional Comments From [EMAIL PROTECTED]  2003-02-14 21:09 -------
Replacing the StringBuffer with a java.io.CharArrayWriter might be an even
better choice. The call to StringBuffer.setLength(0) could be replaced with
CharArrayWriter.reset(), which would duplicate the original intent of not
reallocating the buffer we're accumulating characters into.

The CharArrayWriter would even save a little more memory because it's toString()
creates Strings backed by character arrays equal in length to the length of the
String. StringBuffer's toString() creates Strings backed by character arrays
equal in length to the capacity of the StringBuffer. You only end up wasting a
few bytes here and a few bytes there, but it would add up if you're parsing a
large message.

Reply via email to