mochijson2

11 views
Skip to first unread message

Roberto Saccon

unread,
Nov 27, 2007, 12:05:09 PM11/27/07
to MochiWeb
any recommendation when to use mochijson2 ? It seems to be faster, but
utf-8 only. Are you phasing out mochijson and focusing further
development on mochijson2 or will both continue in parallel ? If the
first is the case, then it is maybe a good idea to switch and adapt
the new syntax.

regards
Roberto

Bob Ippolito

unread,
Nov 27, 2007, 12:28:41 PM11/27/07
to moch...@googlegroups.com
Well, it decodes UTF-8 only, but it encodes as 7-bit safe ASCII with
\u escapes just like it always has. Other input encodings could be
handled by transcoding to UTF-8 before decoding as JSON. I decided it
was more important for us to use binaries since R12 makes them much
faster and we've switched to 64-bit which makes lists even more
bloated.

mochijson will be around as-is at least as long as we still use it,
probably longer. I don't think either of them are going to be changing
very much.. there are some encoding optimizations that could be made
for strings in mochijson2 but I don't see much else happening in
either module.

The APIs are incompatible though, they use different layouts for
strings and arrays. I'm not sure how many people use mochijson as-is,
but we have several projects that do and none of them use mochijson2
yet so we'll need to keep the old API around until we do upgrade all
of our apps.

Reply all
Reply to author
Forward
0 new messages