Created
September 28, 2013 15:46
-
-
Save tomislater/6743373 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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