on master help sign in
Add a Python json benchmark.

Alas, it's about 3x faster than us, due to being written in C.

commitcbe5617222047bc174e470051b5724f84f70609e authorBryan O'Sullivan <bos@mailrank.com> dateThu 27 Jan 2011, 20:48 (16 years ago) parent518ad29
1 file changed+15
benchmarks/parse.py+15
benchmarks/parse.pynew file+15
@@ -0,0 +1,15 @@
1+#!/usr/bin/env python
2+
3+import json, sys, time
4+
5+count = int(sys.argv[1])
6+
7+for n in sys.argv[2:]:
8+ print '%s:' % n
9+ start = time.time()
10+ fp = open(n)
11+ for i in xrange(count):
12+ fp.seek(0)
13+ val = json.load(fp)
14+ end = time.time()
15+ print ' ', end - start