You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Benjamin Reed (JIRA)" <ji...@apache.org> on 2009/02/19 23:54:01 UTC

[jira] Created: (ZOOKEEPER-324) do not materialize strings in the server

do not materialize strings in the server
----------------------------------------

                 Key: ZOOKEEPER-324
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-324
             Project: Zookeeper
          Issue Type: Improvement
          Components: server
            Reporter: Benjamin Reed


We convert paths and authentication information to strings rather than byte[] even though we could work just as well with byte[] for our needs since we don't really interpret the strings. we are just doing basic pattern matching. the only really string manipulations we do with paths is to look for '/', but we could easily to that with byte[] since we use utf8 encoding for the strings. by not materializing the strings we save time doing the serializations and also space since most (almost all) of our strings are ASCII and thus just one byte.

we could probably get by without even changing the jute spec if we make the generated classes check for a flag to see whether strings should be treated as byte[] or String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-324) do not materialize strings in the server

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676829#action_12676829 ] 

Patrick Hunt commented on ZOOKEEPER-324:
----------------------------------------

there's another issue related to this. we have multiple instances of the same string instantiated in various parts of the code (issue regardless of string vs byte representation) if canonicalize (like String intern) we can save significant amounts of memory. For example registering watches on a node (each client registering would use the same string, vs currently using diff strings). We just need to ensure the String/byte[] is immutable (not an issue with string)

> do not materialize strings in the server
> ----------------------------------------
>
>                 Key: ZOOKEEPER-324
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-324
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: server
>            Reporter: Benjamin Reed
>
> We convert paths and authentication information to strings rather than byte[] even though we could work just as well with byte[] for our needs since we don't really interpret the strings. we are just doing basic pattern matching. the only really string manipulations we do with paths is to look for '/', but we could easily to that with byte[] since we use utf8 encoding for the strings. by not materializing the strings we save time doing the serializations and also space since most (almost all) of our strings are ASCII and thus just one byte.
> we could probably get by without even changing the jute spec if we make the generated classes check for a flag to see whether strings should be treated as byte[] or String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.