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.

Reply via email to