keys with spaces in

Ryan T. Dean rtdean-lists-memcache@cytherianage.net
Wed, 29 Oct 2003 11:43:24 -0500


On Wed, Oct 29, 2003 at 11:37:44AM -0500, Justin Matlock wrote:
> That API has a ton of problems -- it was a direct port from Perl and was
> never completely debugged.  Use the newer one written by Ryan Dean -- it
> works much better, and is about 40% faster than the original API.
> 
> http://www.cytherianage.net/~rtdean/memcached-client-php-0.1.1.tar.gz

Actually, visit http://phpca.cytherianage.net/memcached - the latest 
client is version 0.1.2, and its available for download there (along 
with API documentation and the like).

> As far as I know, keys aren't supposed to have spaces; the API could check
> for them -- but that would add another speed degredation... I think that
> should be the responsibility of the code calling the API -- not the API
> itself.
> 
> To check things out; I added a str_replace to strip spaces from keys into
> the 0.1.1 API ... on my site, it slowed the memcached system down about
> 4%... a pretty big speed hit just to catch programmer mistakes.

I'd have to agree.  I think it should be up to the programmer to use 
keys without spaces.  If, for some reason, you really really really want 
/ need spaces, a seperate method could be provided which takes a key 
with spaces and returns a key without spaces... but a str_replace on a 
key for every add/replace/set/get is too much overhead for too little 
gain.

	-Ryan T. Dean

> ----- Original Message ----- 
> From: "Richard Jones" <rj@last.fm>
> To: <memcached@lists.danga.com>
> Sent: Wednesday, October 29, 2003 10:34 AM
> Subject: keys with spaces in
> 
> 
> > i'm using Ryan Gilfethers php api, v 1.0.10.
> > tried to use some keys with spaces in, didn't work.
> > (because spaces used to delimit commands when sent to memcached)
> >
> > added a str_replace command to set and get functions of the api to remove
> > spaces from keys.
> >
> > not sure if other apis do this, i reckon it's a good idea, or should at
> least
> > be an option?
> >
> > Rich.
> >
> >
> >
> >
>