import subprocess import sys import perf # 2 GiB BIG_ALLOC = b'x' * (2 * 1024 * 1024 * 1024) # Program with very short execution time and very small memory footprint ARGS = ["/bin/true"] def func(): proc = subprocess.Popen(ARGS, close_fds=False, restore_signals=False) proc.wait() proc = None runner = perf.Runner() runner.bench_func('func', func)