diff options
author | Bob Ippolito <bob@redivi.com> | 2011-03-14 16:03:54 -0400 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2011-03-14 16:03:54 -0400 |
commit | b83d98a35de3ce18a6aa8a08b3e3b1a38b07e21d (patch) | |
tree | c325d0c87d14facaa6c888f764f2fa2e7d92a2c1 | |
parent | 44246b41333914a1d23dd893a742376ac45c384f (diff) | |
download | simplejson-b83d98a35de3ce18a6aa8a08b3e3b1a38b07e21d.tar.gz |
document write benchmark
-rw-r--r-- | benchmarks/generate_json.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/benchmarks/generate_json.py b/benchmarks/generate_json.py index a68a776..d36af49 100644 --- a/benchmarks/generate_json.py +++ b/benchmarks/generate_json.py @@ -6,12 +6,19 @@ To generate:: $ mkdir -p build/bench; \ python benchmarks/generate_json.py > build/bench/feed.json -To run the benchmark:: +To run the read benchmark:: $ python -m timeit -n 1 -r 5 \ -s 'import simplejson;s = open("build/bench/feed.json", "rb").read()' \ 'simplejson.loads(s)' +To run the write benchmark:: + + $ python -m timeit -n 1 -r 5 \ + -s 'import simplejson;s = open("build/bench/feed.json", "rb").read()' \ + -s 'd = simplejson.loads(s)' \ + 'simplejson.dumps(d)' + """ import sys import operator |