Two minor tweaks.

This commit is contained in:
Ryan Williams
2010-03-15 14:37:38 -07:00
parent 39b24f7f66
commit 160580c155
2 changed files with 7 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import benchmarks
BYTES=1000
SIZE=1
CONCURRENCY=50
TRIES=5
def reader(sock):
expect = BYTES
@@ -82,16 +83,20 @@ if __name__ == "__main__":
default=SIZE)
parser.add_option('-c', '--concurrency', type='int', dest='concurrency',
default=CONCURRENCY)
parser.add_option('-t', '--tries', type='int', dest='tries',
default=TRIES)
opts, args = parser.parse_args()
BYTES=opts.bytes
SIZE=opts.size
CONCURRENCY=opts.concurrency
TRIES=opts.tries
funcs = [launch_green_threads]
if opts.threading:
funcs = [launch_green_threads, launch_heavy_threads]
results = benchmarks.measure_best(3, 3,
results = benchmarks.measure_best(TRIES, 3,
lambda: None, lambda: None,
*funcs)
print "green:", results[launch_green_threads]

View File

@@ -49,7 +49,7 @@ class Pool(object):
http_pool = pools.Pool(create=lambda: httplib2.Http(timeout=90))
or `functools.partial`::
or :func:`functools.partial`::
from functools import partial
http_pool = pools.Pool(create=partial(httplib2.Http, timeout=90))