Debian Codegraph @

docs/core/benchmarks/banana.py

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