[Fwd: [Dev] memcached option to always use non-serialized primitive types?]

Kevin A. Burton burton at newsmonster.org
Mon Dec 13 21:56:21 PST 2004

Evan Martin wrote:

>On Sun, Dec 12, 2004 at 10:28:39PM -0800, Kevin A. Burton wrote:
>>If we assume the basic types are interned we could use the first byte as 
>>the type with the remaining bytes as the value.  Then on get() we could 
>>read the first byte to determine the type and then construct the correct 
>>object for it.  This would prevent the ClassCastException I talked about 
>You can also use the memcached per-item flags to specially store a few
>sorts of types: n bits allows for 2^n different representations.  Byte,
>int, and string ought to be enough for most uses.
Yeah... honestly I saw that and it looked interesting. Whats the size of 
the flag? How many bits?

I really only have 10 types I have to represent and right now the 
java-memcached driver only needs to represent 11 flags (one being gzip 



Use Rojo (RSS/Atom aggregator).  Visit http://rojo.com. Ask me for an 
invite!  Also see irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

If you're interested in RSS, Weblogs, Social Networking, etc... then you 
should work for Rojo!  If you recommend someone and we hire them you'll 
get a free iPod!
Kevin A. Burton, Location - San Francisco, CA
       AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20041213/b7456e2f/attachment-0001.html

More information about the memcached mailing list