import pyperf runner = pyperf.Runner() runner.timeit(name="bench dict part1", stmt="ret = dict({1: 2, 3: 4, 5: 6, 7: 8})", setup = "" )