Skip to content

Instantly share code, notes, and snippets.

@glowskir
Created April 11, 2014 13:35
Show Gist options
  • Save glowskir/10469492 to your computer and use it in GitHub Desktop.
Save glowskir/10469492 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import time
from hot_redis import MultiSetZSet, MultiSet
records = list((str(key), key) for key in xrange(0,1000000))
zset = MultiSetZSet(records)
hashset = MultiSet(records)
print "zset ",
start = time.clock()
zset.most_common(10)
stop = time.clock()
print stop - start
print "hashset ",
start = time.clock()
hashset.most_common(10)
stop = time.clock()
print stop - start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment