xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] Re: [PATCH] Text using java.nio.charset.Charset
- From: Wolfgang Hoschek <whoschek AT lbl.gov>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] Re: [PATCH] Text using java.nio.charset.Charset
- Date: Wed, 30 Jun 2004 14:50:43 -0700
Actually, the data.duplicate() is not necessary.
CHARSET.decode(data).toString() is sufficient as toString() does not alter the buffer's position.
Wolfgang.
On Jun 30, 2004, at 2:05 PM, Wolfgang Hoschek wrote:
Elliotte,
I heard that the ByteToCharConverter used internally by java.lang.String when converting from and to bytes is rather inefficient, and that the new jdk-1.4 Charset coders are much more efficient.
So if you are currently doing benchmarking as seems to be indicated in the last release notes you might want to check if the attached patch or a derivative of it does any good in terms of performance. Unfortunately I'm too busy with tons of other stuff to try and see myself.
Search for changed lines ending with "// WH".
(Note that Charset.encode and decode are thread-safe).
Wolfgang.
-
[XOM-interest] [PATCH] Text using java.nio.charset.Charset,
Wolfgang Hoschek, 06/30/2004
- [XOM-interest] Re: [PATCH] Text using java.nio.charset.Charset, Wolfgang Hoschek, 06/30/2004
Archive powered by MHonArc 2.6.24.