3 ms·
Given the fact that two of the options are persistent and two are in-memory the results seem hardly surprising. What is kind of interesting is that when you lo
by evgen 17y ago
Given the fact that two of the options are persistent and two are in-memory the results seem hardly surprising. What is kind of interesting is that when you look at the results closely you can see what is really being measured - client interface speed. Simply put, there is no way that a tokyo tyrant hash database and a memcached instance should run at the same speed. The former is writing to disk while the latter is not. This means that the bottleneck here is not the cache being "compared", but the client interface code.
If I had the time I would rewrite the client code to use the pytyrant interface talking to an in-memory tyrant hash database to see where things really stack up.
EDIT: If anyone wants to run the benchmarks, just replace the import of memcache in tokyo.py with an import of pytyrant, then replace the run loop with:
t = pytyrant.PyTyrant.open('10.90.15.96', 1978)
hashval = md5(str(self.c) + str(i)).hexdigest()
if self.gs == 'set':
t[hashval] = hashval
else:
t[hashval]