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

Evan Martin martine at danga.com
Wed Dec 15 09:34:07 PST 2004


On Mon, Dec 13, 2004 at 09:56:21PM -0800, Kevin A. Burton wrote:
> >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?

The protocol doc says it's 16 bits.
(It's worth looking through if you're implementing a client:
http://cvs.danga.com/browse.cgi/wcmtools/memcached/doc/protocol.txt?rev=HEAD&content-type=text/x-cvsweb-markup
)

> 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 
> compression).

Well, ten types only needs four bits, so it sounds like you're barely
ok.  (But what are those eleven other flags?)
And you probably don't need to gzip some types.  But it sounds like you
don't need to get fancy yet.

-- 
Evan Martin
martine at danga.com
http://neugierig.org


More information about the memcached mailing list