Peter,

you're right.

So if value in memcache is not of primitive type (and it can't be of
primitive type, because cache operates with objects), you can skip
cache.containsKey() call and analyze result of cache.get() with
equality to null.

In production cache.containsKey() tooks ~20 milliseconds (which is
more than 10% of my request processing time), and I believe this also
uses cpu which makes this call billable. The same time required to
invoke cache.get().

But comparing Object with null tooks almost nothing, so I think this
is the preferable way.

Isn't it?

On Jun 8, 2:01 pm, Peter Ondruska <[email protected]> wrote:
> How I understand memcache:
>
> cache.containsKey("some-key") tells you whether there is such key in
> memcache
> and cache.get("some-key") retrieves the value for key
>
> You could skip asking for existence of the key in memcache only in
> case you expect to return non-null values (and null being non-existent
> object), I may be wrong but this is how I understand memcache.
>
> On Jun 8, 11:07 am, dmitrygusev <[email protected]> wrote:
>
> > Can somebody comment on:
>
> >http://code.google.com/p/googleappengine/issues/detail?id=3319
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to