Redis

Redis Speed

2010/06/08
http://www.digitaldragoon.com/blog/testing-speed-redis-py/ have pget and pset inside, I change to this import cPickle as pickle import zlib import new #################################### # gzip header gzip_header = zlib.compress(“)[:2] #################################### # CUSTOM COMMANDS for Redis #################################### def _pset(self, name, object, compress=False): “”” pickle set for redis client, with compress flag “”” pobj = pickle.dumps(object, pickle.HIGHEST_PROTOCOL) if compress: pobj = zlib.compress(pobj) self.set(name, pobj) def _pget(self, name): “”” pickle get for redis client, automatic to check compress flag