I was reading David Cramer's tip to use JSONField in Django to be able to store arbitrary fields in a SQL database. Nice. But is it fast enough? Well, I can't answer that but I did look into the difference in read/write performance between simplejson, cPickle and marshal.
Only reading:
JSON 0.00593531370163
PICKLE 0.0109532237053
MARSHAL 0.00413788318634
Reading and writing:
JSON 0.0434390544891
PICKLE 0.0289686655998
MARSHAL 0.00728442907333
Clearly marshal is faster but to quote the documentation:
"Warning: The marshal module is not intended to be secure against erroneous or maliciously constructed data. Never unmarshal data received from an untrusted or unauthenticated source."
Clearly simplejson is a very fast reader and the JSON format has the delicious advantage that it's "human readable" (compared to the others).
NOTE! I spent about 5 minutes putting together the script and about 10 minutes writing this so feel free to doubt it's scientific accuracy.