Localmemcache-0.0.1, efficiently sharing a Hashtable on a local Unix machine

Hi,

today I am releasing the very first version of localmemcache (version
0.0.1).
Localmemcache is a library written in C that offers efficient sharing of
a
hashtable between processes on a local Unix machine by taking advantage
of
shared memory. Its Ruby binding aims to be similar to that of the
MemCache
Ruby bindings.

EXAMPLE

require ‘localmemcache’
$lm = LocalMemCache.new :namespace => “viewcounters”
$lm[:foo] = 1
$lm[:foo]
$lm.delete(:foo)

PERFORMANCE

Here’s a quick speed comparison, made on an
Intel(R) Xeon(R) CPU E5205 @ 1.86GHz:

Benchmark pseudo code:

2_000_000.times {
index = rand(10000).to_s
$hash.set(index, index)
$hash.get(index)
}

MemCache: 253326.122 ms
LocalMemCache: 6055.552 ms
Ruby’s Hash: 4963.313 ms

So in this example localmemcache is about 40 times faster than using
memcache
locally, and about 20% slower than Ruby’s hash.

INSTALL

gem install localmemcache

CONTACT

Please contact me with bugs, suggestions and patches at: schween + snafu

de

LINKS

Localmemcache: http://localmemcache.rubyforge.org/
Rubyforge project: http://localmemcache.rubyforge.org/

Source code is hosted on github: GitHub - sck/localmemcache: mmap -> lmc_valloc -> hashtable. BAM database

Best,

Sven C. Koehler

localmemcache-0.0.1.gem 251971dd68451656d756b8bd1abe5879