def benchmark_objson2_set(text, times=1000000): obj = objson.loads2(text) for _ in xrange(times): obj.name = 'benjamin2'
def benchmark_objson2(text, times=100000): for _ in xrange(times): objson.loads2(text)
def benchmark_objson2_get(text, times=1000000): obj = objson.loads2(text) for _ in xrange(times): x = obj.name
def benchmark_objson2_dumps(text, times=100000): obj = objson.loads2(text) for _ in xrange(times): objson.dumps2(obj)