Skip to content

Instantly share code, notes, and snippets.

@tomislater
Created September 28, 2013 15:46
Show Gist options
  • Select an option

  • Save tomislater/6743373 to your computer and use it in GitHub Desktop.

Select an option

Save tomislater/6743373 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import timeit
from umemcache import Client
umc = Client('127.0.0.1:11211')
umc.connect()
def worker():
for s in (str(i) for i in xrange(1000)):
umc.set(s, s.capitalize())
umc.get(s)
umc.incr(s, 1)
umc.decr(s, 1)
t = 0
for _ in xrange(3):
t += timeit.timeit(worker, number=100)
print t / 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment