db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5210) Use java.nio.ByteBuffer in client.net.Request
Date Thu, 05 May 2011 10:13:03 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029257#comment-13029257

Knut Anders Hatlen commented on DERBY-5210:

I changed Utf8CcsidManager to use a CharsetEncoder to encode strings directly into the ByteBuffer
and reran the experiment (will post a patch on DERBY-5068 soon). With these changes, I saw
reduced CPU usage compared to (still no observable change in throughput, though).
So I think it's safe to assume that although the 1a patch seen in isolation makes the client
driver use slightly more CPU, it enables us to add optimizations that outweigh the extra cost.
And, regardless of that, the extra cost seems to be so small that it might be worthwhile to
check in the patch in any case, just because it makes the code simpler.

> Use java.nio.ByteBuffer in client.net.Request
> ---------------------------------------------
>                 Key: DERBY-5210
>                 URL: https://issues.apache.org/jira/browse/DERBY-5210
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d5210-1a.diff
> We should see if we could use a java.nio.ByteBuffer instead of a byte array in org.apache.derby.client.net.Request,
similar to what we did for DDMWriter in DERBY-2936. ByteBuffer provides some helper methods
that allows us to simplify the code that puts multi-byte values into the buffer (like ByteBuffer.putShort(),
putInt(), putLong()). It may also be a first step on the way to using a CharsetEncoder to
encode strings without going via an intermediate throw-away byte array (see DERBY-5068 for

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message