(original) (raw)
changeset: 139:7c7dc1c4d8d4 branch: 2n3 user: Antoine Pitrou solipsis@pitrou.net date: Fri Nov 12 21:48:10 2010 +0100 files: perf.py description: Issue #10397: fix --track-memory on py3k. Patch by Bobby Impollonia. diff -r 44be2d44a2f1 -r 7c7dc1c4d8d4 perf.py --- a/perf.py Thu Oct 07 11:47:53 2010 +0200 +++ b/perf.py Fri Nov 12 21:48:10 2010 +0100 @@ -1551,7 +1551,7 @@ # Without this, Python may start and exit before the memory sampler # thread has time to work. We can't just do 'time.sleep(x)', because # under -S, 'import time' fails. - work = "for _ in xrange(200000): pass" + work = "i = 0\nwhile i < 200000: i += 1" command = python + cmd_opts + ["-c", work] mem_usage = [] info("Running `%s` %d times", command, num_loops * 20) /solipsis@pitrou.net