On Mar 4, 2006, at 11:19, [EMAIL PROTECTED] wrote:

Von: "Andreas L Delmelle"<[EMAIL PROTECTED]>

On Mar 1, 2006, at 08:46, [EMAIL PROTECTED] wrote:

You changed the Writer.write to StringBuffer operations. I'd say
that appending to a StringBuffer is much slower than writing
directly to a BufferedOutputStream.

Really? Well, I have to admit, this was a late-night idea :-/
And I didn't read the TechTips for a long time:

http://java.sun.com/developer/TechTips/1998/tt0120.html

So String vs. StringBuffer is 1:1/6 (StringBuffer.append is six times faster or needs only a sixth than concatenating Strings). And StringBuffer.append->Writer vs. String->BufferedWriter is not mentioned that explicitly anywhere, but if both are StringBuffer- techniques, this is only two times slower. As said before, RTF is quite fast, no layout managing, that sort of thing. So not that bad at all...

You're quite right, I believe. Any changes to this will lead to a marginal overall improvement at best.

This whole thing got me wondering, though, if there are any other places in the rtf-lib where characters outside of the 7-bit ASCII range are incorrectly written to the output as characters (instead of passing through RtfStringConverter to do unicode escapes).

We'll keep looking as well.

Thanks for your input/feedback!

Cheers,

Andreas

Reply via email to