Thrift, Protocol Buffers and JSON comparison
bouncybouncy.net
bouncybouncy.net
http://groups.google.com/group/protobuf/browse_thread/thread...
Simplejson was slightly faster on two out of three tests. Consistently so, when I re-ran the tests.
Test environment: py2.6 on Mac OS X, with simplejson 2.0.9 and python-cjson 1.0.5
Test script: http://gist.github.com/72413
Also, I changed the test script from using time.time() to time.clock(), which according to the python docs should be used for performance testing on unixes.
http://bouncybouncy.net/ramblings/posts/json_vs_thrift_and_p...
Protocol buffers won hands down as far as space used...
The speed issues are still there, but I'm sure that over time things will improve. If the C extension for simplejson can speed up serialization by an order of magnitude, I have no doubt that similar improvements can be made to protocol buffers and thrift.
(Not speaking from experience, just from what I remember of the format when I read the specs).
You might as well be testing how quickly thrift / pb / json could serialize / deserialize pickled blobs. Your not giving thrift or pb the data it's designed to perform well with, so the fact that it fails isn't surprising.
I'm sure a tesla would suck compared to an ancient pickup at helping me pick up a couch from craigslist, but I wouldn't say that the pickup is a better car because of that.
option optimize_for = SPEED;