evan/memcached — pull request #103 by ccocchi (2012-09-05 13:34:15+00:00)
Title: Add memcache_exist() function

This PR add the function memcached_exist() to libmemcached. This is a port from the function introduced in version 0.53 of libmemcached.

The wrapper expose this method through the `exist` method, that returns nil in case the key exist or raises Memcached::NotFound is it doesn't.

This is a performance gain for store using memcached gem as client and implementing the `exist?` method.
For example, using this [store](http://github.com/ccocchi/libmemcached_store/tree/remove-as-entry), here are the results :

```
Testing with
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

Before patch:
exist:miss:libm 0.060000 0.040000 0.100000 ( 0.209961)
exist:hit:libm 0.050000 0.050000 0.100000 ( 0.177668)

After patch:
exist:miss:libm 0.030000 0.030000 0.060000 ( 0.114763)
exist:hit:libm 0.020000 0.030000 0.050000 ( 0.105897)
```