RE: Interesting Balisage paper on JSON vs. XML performance in the browser

> The paper looks very good, but it's obviously incomplete as it doesn't test JSON parsing speed using JSON.parse. I don't know exactly > how fast is JSON.parse compared to eval, but JSON is just some subset of JS syntax and it might be parsed faster.


The set of things the experiment this paper is based on does not test is infinite.
I encourage people, if interested, to clone this test, try changes and perhaps we can come up with a better test.
Or at least a different one.  More is better.

I did try JSON.parse() when constructing the original test and it made little difference so decided to limit the test
to the "classic" eval() and jQuery.parse().   My goal in this test was to be broad, not deep.  That is to sample a wide spectrum
of corpus using techniques reasonably representative of common use.   But as with all such test, no test will be able to simulate
"your application". 



-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
dlee@marklogic.com
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com


-----Original Message-----
From: Konstantinov Sergey [mailto:twirl@yandex-team.ru] 
Sent: Monday, August 12, 2013 1:46 AM
To: Noah Mendelsohn; www-tag@w3.org
Cc: David Lee
Subject: Re: Interesting Balisage paper on JSON vs. XML performance in the browser


12.08.2013, 05:24, "Noah Mendelsohn" <nrm@arcanedomain.com>:
> David Lee has written an interesting analysis of JSON vs. XML performance.
> There's lots of detail and (seamingly) very careful measurements.  From the
> conclusion section:
>
> "Given the same document object, one can produce nearly identical sized
> JSON and XML representations. Network transfer speed is directly related to
> the document size so is unaffected by the markup given similar size.
> Compressed documents in all formats even very "Fat" representations of JSON
> or XML compress to nearly identical size which is an indicator that they
> contain approximately the same entropy or information content and
> transferring these documents to a wide variety of devices takes effectively
> the same time per device. Parsing speed varies on the technique used. Pure
> JavaScript parsing generally performs better with XML then with JSON but
> not always, while Query speed generally is faster for JSON, but again, not
> always. Overall using native JavaScript the use of XML and JSON is
> essentially identical performance for total user experience (transfer plus
> parse plus query), however use of the popular JavaScript library jQuery
> imposes a steep penalty on both JSON and XML, more-so for XML. [4]"
>
> The whole paper is well worth reading IMO.
>
> Noah
>
> [1]
> http://www.balisage.net/Proceedings/vol10/html/Lee01/BalisageVol10-Lee01.html

-- 
Konstantinov Sergey
Yandex Maps API Development Team Lead
http://api.yandex.com/maps/

Received on Monday, 12 August 2013 12:51:32 UTC