Skip to content

Instantly share code, notes, and snippets.

@j2labs
Created February 8, 2012 01:05
Show Gist options
  • Save j2labs/1763847 to your computer and use it in GitHub Desktop.
Save j2labs/1763847 to your computer and use it in GitHub Desktop.
A fresh cerealization.
$ python ./cereal.py
Dumping:
json: 16.3266839981
simplejson: 21.8916499615
cjson: 5.22964906693
ujson: 2.02208805084
cPickle: 18.5925779343
tnetstrings: 60.592509985
tnetstring: 2.44516205788
msgpack: 21.7611129284
Loading:
json: 22.2162308693
simplejson: 9.47978711128
cjson: 2.78990912437
ujson: 2.36525583267
cPickle: 8.52249503136
tnetstrings: 76.8928740025
tnetstring: 1.75321888924
msgpack: 1.78684711456
@kracekumar
Copy link

[kracekumar@web303 cerealization]$ python2.7 cereal.py
Dumping:
json: 15.5129170418
simplejson: 20.3036308289
cjson: 5.0124309063
ujson: 1.94438791275
cPickle: 13.46560812
tnetstrings: 46.9091620445
tnetstring: 1.78715896606
Loading:
json: 21.7409291267
simplejson: 10.3471329212
cjson: 2.16987895966
ujson: 2.94849014282
cPickle: 6.49865698814
tnetstrings: 67.0292310715
tnetstring: 1.87403416634
[kracekumar@web303 cerealization]$ uname -a
Linux web303 2.6.32-220.4.1.el6.x86_64 #1 SMP Tue Jan 24 02:13:44 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

I still find tnetstrings slower

@apg
Copy link

apg commented Feb 8, 2012

$ python cereal.py
Dumping:
json: 7.4592730999
simplejson: 9.91000509262
cjson: 2.51517486572
ujson: 1.05800700188
cPickle: 7.16241598129
tnetstrings: 20.4144198895
tnetstring: 1.0829000473
msgpack: 1.61535906792
Loading:
json: 9.58285999298
simplejson: 4.65798306465
cjson: 1.48336911201
ujson: 1.48318600655
cPickle: 4.28716301918
tnetstrings: 27.1858258247
tnetstring: 0.966851949692
msgpack: 1.08843994141

@redaready
Copy link

Dumping:
json: 5.32163596153
simplejson: 6.15272092819
cjson: 2.12723398209
ujson: 0.846822977066
cPickle: 5.46017313004
tnetstrings: 16.7212948799
tnetstring: 0.83106303215
msgpack: 1.33516907692
Loading:
json: 6.95729899406
simplejson: 3.31293916702
cjson: 0.97765994072
ujson: 1.03961896896
cPickle: 2.49322104454
tnetstrings: 22.0624539852
tnetstring: 0.698086977005
msgpack: 0.80099606514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment