More about XML-to-JSON

antranig at caret.cam.ac.uk antranig at caret.cam.ac.uk
Thu Jun 18 23:10:23 UTC 2009


Hi there David - thanks for bringing this parser to our attention. I have
added it to my general set of benchmarks as "parseYusuke".
https://source.fluidproject.org/svn/sandbox/engage-sketches/trunk/src/html/mapping.html
Other than the anomalously quick result on Opera, the timings are general inline
with my "parseDOM" method which uses a very similar strategy. On FF2 there is a
speedup of perhaps 10% over "parseDom" but on FF3 I see no
significant difference.
This method isn't terribly interesting to us since it relies on a browser
DOM for parsing, and it is most likely that our document conversion will
be done on a standalone system.
In general when doing timings you should take care to perform more iterations
than 1, in order to stamp out variation and also average over garbage
collection costs which can be irregular. There is some excellent discussion
on John Resig's blog here:
http://ejohn.org/blog/javascript-benchmark-quality/

In general a test which takes less than a couple of seconds to run will be
so subject to error that the results will be arguable.
There are particular issues in Windows machines, with respect to clock
granularity - Resig also discusses these on another blog posting.

Cheers,
Antranig.

Quoting David Trelles <davetrey at gmail.com>:

> I just want to share with you some performance tests with JKL parser (
> http://www.kawa.net/works/js/jkl/parsexml-e.html). It does the same as the
> others xml-to-json parsers. But I think is quite interesting, though. I've
> just converted McCord xml data into json object.
> Here you have some interesting links I've looking on Internet that you may
> find interesting:
>
> http://www.thomasfrank.se/xml_to_json.html (already tested by Antranig).
>
> http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
>
> http://www.kawa.net/works/js/jkl/parsexml-e.html
>
>
> Here are my results:
>
> PERFORMANCE TESTS. XML TO JSON (using JKL).
>
> Local test (Using Wamp Server)
>
> Internet Explorer 7 (32bits)
>
> Headdress.xml | used time: 69ms
> Cartoon.xml | used time: 13 ms
> Photograph.xml | used time: 9 ms
> Snuffbox.xml | used time: 19 ms
> Total time conversion (4 xml docs): 110 ms
>
> ------------------------------------------
> ------------------------------------------
>
> FF3
>
> Headdress.xml | used time: 31ms
> Cartoon.xml | used time: 15 ms
> Photograph.xml | used time: 13 ms
> Snuffbox.xml | used time: 20 ms
> Total time conversion (4 xml docs): 79 ms
>
> -------------------------------------------
> -------------------------------------------
>
> Opera 9.64
>
> Headdress.xml | used time: 3ms
> Cartoon.xml | used time: 5 ms
> Photograph.xml | used time: 4 ms
> Snuffbox.xml | used time: 6 ms
> Total time conversion (4 xml docs): 18 ms
>
>
> ------------------------------------------
> ------------------------------------------
> ------------------------------------------
>
>
>
> Wireless Connection (3Mb/sec)
>
> Internet Explorer 7 (64bits)
>
> Headdress.xml | used time: 184ms
> Cartoon.xml | used time: 129 ms
> Photograph.xml | used time: 106 ms
> Snuffbox.xml | used time: 164 ms
> Total time conversion (4 xml docs): 583 ms
>
>
> ------------------------------------------
> ------------------------------------------
>
> Opera 9.64
>
> Headdress.xml | used time: 113ms
> Cartoon.xml | used time: 164 ms
> Photograph.xml | used time: 89 ms
> Snuffbox.xml | used time: 137 ms
> Total time conversion (4 xml docs): 503 ms
>
> ------------------------------------------
> ------------------------------------------
>
> FF3
>
> Headdress.xml | used time: 249ms
> Cartoon.xml | used time: 536 ms
> Photograph.xml | used time: 169 ms
> Snuffbox.xml | used time: 1192 ms
> Total time conversion (4 xml docs): 2146 ms
>
> ------------------------------------------
> ------------------------------------------
> ------------------------------------------
>
> Perfomance tests. Second test. (30Mb/sec)
>
> FF3
>
> Headdress.xml | used time: 194ms
> Cartoon.xml | used time: 181 ms
> Photograph.xml | used time: 163 ms
> Snuffbox.xml | used time: 185 ms
> Total time conversion (4 xml docs): 723 ms
>
> --------------------------------------------
> --------------------------------------------
>
> Opera 9.64
>
> Headdress.xml | used time: 102ms
> Cartoon.xml | used time: 122 ms
> Photograph.xml | used time: 84 ms
> Snuffbox.xml | used time: 120 ms
> Total time conversion (4 xml docs): 428 ms
>
> ---------------------------------------------
> ---------------------------------------------
>
> Internet Explorer 7 (32bits)
>
> Headdress.xml | used time: 115ms
> Cartoon.xml | used time: 100 ms
> Photograph.xml | used time: 83 ms
> Snuffbox.xml | used time: 138 ms
> Total time conversion (4 xml docs): 437 ms
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.