Commits

Lukas Diekmann committed e4a5736

added dictstrategy benchmark

Comments (0)

Files changed (1)

benchmarks/dictstrategy.py

+import libbench
+
+def bench(benchmark):
+    n = 1000000
+
+    d1 = {}.fromkeys(xrange(n))
+    #benchmark.hook("int dict")
+
+    d2 = {}.fromkeys(str(i) for i in xrange(n))
+    benchmark.hook("dicts")
+
+    d2 = None
+    d1 = None
+
+if __name__ == '__main__':
+    b = libbench.Benchmark(bench)
+    b.main()
+