object (de)serialization with Helma
robert provided a handy "PropertyMgr" for Antville quite some time ago, which allows to store arbitrary objects within a single db-column.
we still use this mechanism a lot. yesterday i finally switched our twoday.net installation from using the xerces-parser (xerces 2.8.0) instead of helma's default crimson parser, which is already quite outdated (and behaves buggy under weird circumstances).
i did some benchmarking now, in order to compare the performance of the two parsers, and to compare them also to a possible JSON-serialization format.
Here are the measured times for serializing and deserializing a dummy hopobject with several properties:
we still use this mechanism a lot. yesterday i finally switched our twoday.net installation from using the xerces-parser (xerces 2.8.0) instead of helma's default crimson parser, which is already quite outdated (and behaves buggy under weird circumstances).
i did some benchmarking now, in order to compare the performance of the two parsers, and to compare them also to a possible JSON-serialization format.
Here are the measured times for serializing and deserializing a dummy hopobject with several properties:
xerces 2.8.0:
10000 writes: 5100ms
10000 reads: 950ms
crimson 1.1:
10000 writes: 900ms
10000 reads: 900ms
rhino 1.5 eval/uneval:
10000 writes: 1400ms
10000 reads: 600ms
rhino 1.6 eval/uneval:
10000 writes: 1050ms
10000 reads: 550ms
json:
10000 writes: 3700ms
10000 reads: 12000ms
conclusion: eval/uneval is of course the fastest, but the xml-parsers are not that far behind. unfortunately the much safer json-implementation seems to be up to 20times slower than uneval when it comes to reading from strings.michi - 30.Aug 2006 12:21 - technisches