Wednesday, December 11


Ion Engines?

Maybe not.

I tried out the Python library for Amazon Ion (their enhanced version of JSON).

It works fine; the code is clean and well-commented and documented.

Encoding is about twelve times slower than JSON for small objects and up to thirty times slower for larger objects - compared to the PyPy built-in JSON module, which is very fast.

By the time I added custom JSON encoders to handle dates and times, decimals, and tuples, the difference was down to eight times, and the JSON was 50% larger than the Ion encoding.

Adding sets to the data mix I discovered two things:
  1. The Ion library can't encode sets.
  2. The Ion library doesn't support custom encoders.

So it's very handy if you need the JSON datatypes plus dates, decimals, and tuples, but if you need more than that you're out of luck.

The Python MessagePack library doesn't support dates yet either, but does support custom types.  It's no faster than JSON (though the output is substantially smaller), and it produces binary data rather than safe ASCII text files.

Update: Something I missed - Ion is a strict superset of JSON.  So is YAML, but Ion knew when to stop, or at least, knew that it should stop at some point.

Posted by: Pixy Misa at 11:35 PM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 211 words, total size 1 kb.

Apple pies are delicious. But never mind apple pies. What colour is a green orange?

44kb generated in CPU 0.04, elapsed 0.2288 seconds.
56 queries taking 0.2061 seconds, 294 records returned.
Powered by Minx 1.1.6c-pink.