We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dbd14e commit e32711aCopy full SHA for e32711a
bench/bench.py
@@ -0,0 +1,19 @@
1
+from functools import reduce
2
+from textwrap import dedent as dd
3
+from timeit import repeat
4
+
5
6
+sources = ["canada", "citm_catalog", "citylots", "twitter"]
7
8
+min_times = []
9
+for source in sources:
10
+ s = dd(f"""\
11
+ with open("../data/{source}.json") as f:
12
+ json.load(f)""")
13
+ times = repeat(stmt=s, setup="import json", repeat=3, number=1)
14
+ t = reduce(min, times)
15
+ print(f"{source} {t:0.06f} seconds")
16
+ min_times.append(t)
17
18
+geo_mean = reduce(lambda a, b: a*b, min_times)**(1/len(min_times))
19
+print(f"Total (G.M): {geo_mean:0.06f}")
0 commit comments