« Return to Thread: new json parser

Re: new json parser

by Chris Anderson-11 :: Rate this Message:

Reply to Author | View in Thread

On Fri, Aug 8, 2008 at 9:22 AM, Bob Ippolito <bob@...> wrote:

> 2008/8/8 Willem de Jong <w.a.de.jong@...>:
>> Hi all,
>>
>> I have uploaded a json parser to trapexit.
>> (http://forum.trapexit.org/viewtopic.php?p=44029#44029)
>>
>> Included is a handler function that translates the SAX events into the same
>> output format produced by mochijson2. Looks like this: {struct,
>> [{<<"key1">>, <<"value1">>}, {<<"key2">>, 123}]}. Interestingly, the new
>> parser (sax parser combined with handler) is roughly 2x as fast as
>> mochijson2 (On my PC, at least).

I added another handler that output the B. term format ( JSON {} =>
Erlang {[]} ) which turned out to be a 6 character change from
Willem's handler. I also added a variation on mochijson's test suite,
and profile() function that runs the test suite under fprof.

You can profile by json_parser:profile().

The paste is available here: http://gist.github.com/4651

Chris

--
Chris Anderson
http://jchris.mfdz.com
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions

 « Return to Thread: new json parser