#1857: buildbot.util should prefer simplejson over built-in json
------------------------+-----------------------
Reporter: catlee | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: undecided
Version: 0.8.3p1 | Keywords:
------------------------+-----------------------
Python 2.6's json is significantly slower than simplejson.
{{{
import json
import simplejson
import time
def task(module, data):
encoded = module.dumps(data)
orig = module.loads(encoded)
assert data == orig
n = 1000
data = {}
for i in range(100):
data[str(i)] = "hello" * i
for module in json, simplejson:
s = time.time()
for i in range(n):
task(module, data)
e = time.time()
print module.__name__, e-s
}}}
outputs
{{{
json 1.52023100853
simplejson 0.200721979141
}}}
on my system with python 2.6.6.
Python 2.7 is much improved:
{{{
json 0.206233024597
simplejson 0.189265012741
}}}
Buildbot should prefer simplejson for python <= 2.6.
--
Ticket URL: <http://trac.buildbot.net/ticket/1857>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Buildbot-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/buildbot-commits