~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/core/benchmarks/banana.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from timer import timeit
 
4
from twisted.spread.banana import b1282int
 
5
 
 
6
ITERATIONS = 100000
 
7
 
 
8
for length in (1, 5, 10, 50, 100):
 
9
    elapsed = timeit(b1282int, ITERATIONS, "\xff" * length)
 
10
    print "b1282int %3d byte string: %10d cps" % (length, ITERATIONS / elapsed)