directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: Strig vs Byte[] for values in the server : some new ideas
Date Thu, 22 Aug 2013 09:43:35 GMT
Le 8/22/13 11:32 AM, Kiran Ayyagari a écrit :
> On Thu, Aug 22, 2013 at 2:56 PM, Emmanuel Lécharny <elecharny@gmail.com>wrote:
>
>> Making the UpValue a byte[] will save us a lot of wasted CPU, and
>> probably a bit of space on disk, as a String requires 2 bytes per char
>> to be serialized.

even the byte[] will be of same size, I don't see where the gain is
am I missing something?


String are encoded using char[], and a char is 2 bytes. a UTF-8 encoded String will encode
the chars on 1 to 6 bytes (well, 1 to 3 in real waorld), and for any char below 0x7F will
be encoded as 1 byte.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Mime
View raw message