<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Speeding Up AJAX with JSON</title>
	<atom:link href="http://ajaxian.com/archives/speeding-up-ajax-with-json/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/speeding-up-ajax-with-json</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Sat, 20 Mar 2010 13:30:04 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mskinner</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-267309</link>
		<dc:creator>mskinner</dc:creator>
		<pubDate>Wed, 10 Sep 2008 14:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-267309</guid>
		<description>We are using ColdFusion to create a new Internet Portal to replace Share Point. Since I have been working on this project I have been getting more negative by the day on ColdFusion. It is soooooo slow on IE, works great on FF and Safari.  I have no choice to use IE. 

I am using every new Ajax feature possible in order to the users a rich client application experience.  I seems that I will need to abandon all of my work is I can’t get to speed up. It takes 20 seconds for a page to load even when everything is cached, only a few seconds with other browsers.  

What do I need to do to make it FAST?</description>
		<content:encoded><![CDATA[<p>We are using ColdFusion to create a new Internet Portal to replace Share Point. Since I have been working on this project I have been getting more negative by the day on ColdFusion. It is soooooo slow on IE, works great on FF and Safari.  I have no choice to use IE. </p>
<p>I am using every new Ajax feature possible in order to the users a rich client application experience.  I seems that I will need to abandon all of my work is I can’t get to speed up. It takes 20 seconds for a page to load even when everything is cached, only a few seconds with other browsers.  </p>
<p>What do I need to do to make it FAST?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AC</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-8513</link>
		<dc:creator>AC</dc:creator>
		<pubDate>Wed, 03 May 2006 11:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-8513</guid>
		<description>I would add a further requirement that strings should be distinguishable from numbers, so that 1 != &quot;1&quot;. This is notoriously cumbersome in XML.</description>
		<content:encoded><![CDATA[<p>I would add a further requirement that strings should be distinguishable from numbers, so that 1 != &#8220;1&#8243;. This is notoriously cumbersome in XML.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6917</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 14 Apr 2006 19:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6917</guid>
		<description>No...&lt;i&gt;your&lt;/i&gt; XML sucked compared to his Hubris.  Yours didn&#039;t even complete the requested requirements.  His clearly shows the requirements and one can understand that the first object is not an array yet holds the value of &quot;one&quot;.  The other two are arrays.  Standards are there for a purpose ;)  Nice post Doug Van Horn.</description>
		<content:encoded><![CDATA[<p>No&#8230;<i>your</i> XML sucked compared to his Hubris.  Yours didn&#8217;t even complete the requested requirements.  His clearly shows the requirements and one can understand that the first object is not an array yet holds the value of &#8220;one&#8221;.  The other two are arrays.  Standards are there for a purpose ;)  Nice post Doug Van Horn.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hubris Sonic</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6541</link>
		<dc:creator>Hubris Sonic</dc:creator>
		<pubDate>Tue, 11 Apr 2006 03:37:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6541</guid>
		<description>
&lt;b&gt;The right tool for job.&lt;/b&gt;

My point exactly.  However &lt;i&gt;my&lt;/i&gt; XML was better ;)  youre a schema guy. i can tell.</description>
		<content:encoded><![CDATA[<p><b>The right tool for job.</b></p>
<p>My point exactly.  However <i>my</i> XML was better ;)  youre a schema guy. i can tell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Van Horn</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6430</link>
		<dc:creator>Doug Van Horn</dc:creator>
		<pubDate>Mon, 10 Apr 2006 12:09:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6430</guid>
		<description>Hubris and Michael,

To be fair, in my opinion, your XML doesn&#039;t (and can&#039;t (1)) take advantage of the purpose of XML, which is to have a DTD or XSD defining what the data should look like.  When interchanging data between two systems, this is the /real/ advantage of XML (again, IMO).  I can publish a service with an XSD and you can write a program to parse any document I generate which validates against that XSD.  We can do this comletely independently of one another.

If all I want to do move information from one part of MY system to another part of MY system, I know and control the code on either end of the exchange.  That&#039;s where XML loses it&#039;s advantage.  JSON shines in that space because I can quickly move a data structure across the wire into one programming language or another with minimal parsing effort.

When publishing a service, or accepting data from the general public, XML would be my first choice.  DTD/XSDs allow me to publish what I dole out or accept in a nice, widely understood format that you can code to.  When I control both ends of the communication, and one of those ends is in Javascript, I use JSON.

So, remember, the right tool for job.

(1) A better XML document:

&lt;code&gt;
&lt;object name=&quot;obj&quot;&gt;
&#160;&#160;&lt;property name=&quot;prop&quot; value=&quot;value&quot; /&gt;
&#160;&#160;&lt;property name=&quot;notarray&quot; value=&quot;one&quot; /&gt;
&lt;/object&gt;
&lt;object name=&quot;obj1&quot;&gt;
&#160;&#160;&lt;property name=&quot;prop1&quot; value=&quot;value&quot; /&gt;
&#160;&#160;&#160;&#160;&lt;array name=&quot;array1&quot;&gt;
&#160;&#160;&#160;&#160;&lt;element value=&quot;one&quot; /&gt;
&#160;&#160;&lt;/array&gt;
&lt;/object&gt;
&lt;object name=&quot;obj2&quot;&gt;
&#160;&#160;&lt;property name=&quot;prop2&quot; value=&quot;value&quot; /&gt;
&#160;&#160;&lt;array name=&quot;array2&quot;&gt;
&#160;&#160;&#160;&#160;&lt;element value=&quot;one&quot; /&gt;
&#160;&#160;&#160;&#160;&lt;element value=&quot;two&quot; /&gt;
&#160;&#160;&lt;/array&gt;
&lt;/object&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hubris and Michael,</p>
<p>To be fair, in my opinion, your XML doesn&#8217;t (and can&#8217;t (1)) take advantage of the purpose of XML, which is to have a DTD or XSD defining what the data should look like.  When interchanging data between two systems, this is the /real/ advantage of XML (again, IMO).  I can publish a service with an XSD and you can write a program to parse any document I generate which validates against that XSD.  We can do this comletely independently of one another.</p>
<p>If all I want to do move information from one part of MY system to another part of MY system, I know and control the code on either end of the exchange.  That&#8217;s where XML loses it&#8217;s advantage.  JSON shines in that space because I can quickly move a data structure across the wire into one programming language or another with minimal parsing effort.</p>
<p>When publishing a service, or accepting data from the general public, XML would be my first choice.  DTD/XSDs allow me to publish what I dole out or accept in a nice, widely understood format that you can code to.  When I control both ends of the communication, and one of those ends is in Javascript, I use JSON.</p>
<p>So, remember, the right tool for job.</p>
<p>(1) A better XML document:</p>
<p><code><br />
&lt;object name="obj"&gt;<br />
&nbsp;&nbsp;&lt;property name="prop" value="value" /&gt;<br />
&nbsp;&nbsp;&lt;property name="notarray" value="one" /&gt;<br />
&lt;/object&gt;<br />
&lt;object name="obj1"&gt;<br />
&nbsp;&nbsp;&lt;property name="prop1" value="value" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;array name="array1"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;element value="one" /&gt;<br />
&nbsp;&nbsp;&lt;/array&gt;<br />
&lt;/object&gt;<br />
&lt;object name="obj2"&gt;<br />
&nbsp;&nbsp;&lt;property name="prop2" value="value" /&gt;<br />
&nbsp;&nbsp;&lt;array name="array2"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;element value="one" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;element value="two" /&gt;<br />
&nbsp;&nbsp;&lt;/array&gt;<br />
&lt;/object&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hubris Sonic</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6427</link>
		<dc:creator>Hubris Sonic</dc:creator>
		<pubDate>Mon, 10 Apr 2006 07:54:14 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6427</guid>
		<description>&lt;obj prop=&quot;value&quot;/&gt;
&lt;obj1 prop=&quot;value&quot;&gt;
    &#160;&#160;&#160;   &lt;array&gt;one&lt;/array&gt;
&lt;/obj1&gt;
&lt;obj2 prop=&quot;value&quot;&gt;
    &#160;&#160;&#160;   &lt;array&gt;one&lt;/array&gt;
    &#160;&#160;&#160;   &lt;array&gt;two&lt;/array&gt;
&lt;/obj2&gt;</description>
		<content:encoded><![CDATA[<p>&lt;obj prop=&#8221;value&#8221;/&gt;<br />
&lt;obj1 prop=&#8221;value&#8221;&gt;<br />
    &nbsp;&nbsp;&nbsp;   &lt;array&gt;one&lt;/array&gt;<br />
&lt;/obj1&gt;<br />
&lt;obj2 prop=&#8221;value&#8221;&gt;<br />
    &nbsp;&nbsp;&nbsp;   &lt;array&gt;one&lt;/array&gt;<br />
    &nbsp;&nbsp;&nbsp;   &lt;array&gt;two&lt;/array&gt;<br />
&lt;/obj2&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niks</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6424</link>
		<dc:creator>Niks</dc:creator>
		<pubDate>Mon, 10 Apr 2006 06:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6424</guid>
		<description>One more such tool at: http://info-sense.net/color.html</description>
		<content:encoded><![CDATA[<p>One more such tool at: <a href="http://info-sense.net/color.html" rel="nofollow">http://info-sense.net/color.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geary</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6423</link>
		<dc:creator>Michael Geary</dc:creator>
		<pubDate>Mon, 10 Apr 2006 05:50:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6423</guid>
		<description>OK, Hubris, time to put your money where your mouth is. :-)

Given these JSON objects:

&#039;obj&#039;: { &#039;prop&#039;: &#039;value&#039;, &#039;notarray&#039;: &#039;one&#039; }

&#039;obj1&#039;: { &#039;prop1: &#039;value&#039;, &#039;array1&#039;: [ &#039;one&#039; ] }

&#039;obj2&#039;: { &#039;prop2: &#039;value&#039;, &#039;array2&#039;: [ &#039;one&#039;, &#039;two&#039; ] }

Show me the equivalent XML that clearly indicates that array1 is an array with one element, array2 is an array with two elements, and notarray is not an array at all.</description>
		<content:encoded><![CDATA[<p>OK, Hubris, time to put your money where your mouth is. :-)</p>
<p>Given these JSON objects:</p>
<p>&#8216;obj&#8217;: { &#8216;prop&#8217;: &#8216;value&#8217;, &#8216;notarray&#8217;: &#8216;one&#8217; }</p>
<p>&#8216;obj1&#8242;: { &#8216;prop1: &#8216;value&#8217;, &#8216;array1&#8242;: [ 'one' ] }</p>
<p>&#8216;obj2&#8242;: { &#8216;prop2: &#8216;value&#8217;, &#8216;array2&#8242;: [ 'one', 'two' ] }</p>
<p>Show me the equivalent XML that clearly indicates that array1 is an array with one element, array2 is an array with two elements, and notarray is not an array at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hubris Sonic</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6415</link>
		<dc:creator>Hubris Sonic</dc:creator>
		<pubDate>Mon, 10 Apr 2006 01:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6415</guid>
		<description>&lt;i&gt;JSON can express maps and arrays much more clearly than XML. In XML all maps and arrays are expressed by convention rather than as part of the data format itself. With JSON there is no chance of misinterpretation.&lt;/i&gt;

give me a break. YOU think JSON can express maps and array more clearly. thats what YOU think. dont state that empirically. Secondly, &#039;no chance&#039; of misinterpretation? right... how long have you been programming?</description>
		<content:encoded><![CDATA[<p><i>JSON can express maps and arrays much more clearly than XML. In XML all maps and arrays are expressed by convention rather than as part of the data format itself. With JSON there is no chance of misinterpretation.</i></p>
<p>give me a break. YOU think JSON can express maps and array more clearly. thats what YOU think. dont state that empirically. Secondly, &#8216;no chance&#8217; of misinterpretation? right&#8230; how long have you been programming?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geary</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6303</link>
		<dc:creator>Michael Geary</dc:creator>
		<pubDate>Fri, 07 Apr 2006 21:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6303</guid>
		<description>JoJo, Patrick is talking about using a script tag to load the JSON, not XMLHttpRequest. So it does work cross-domain, and you do need to take into account whether you trust the party you&#039;re loading the JSON from.</description>
		<content:encoded><![CDATA[<p>JoJo, Patrick is talking about using a script tag to load the JSON, not XMLHttpRequest. So it does work cross-domain, and you do need to take into account whether you trust the party you&#8217;re loading the JSON from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JoJo Json</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6294</link>
		<dc:creator>JoJo Json</dc:creator>
		<pubDate>Fri, 07 Apr 2006 20:01:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6294</guid>
		<description>Dude, you can only make an XmlHttpRequest to the domain that served you the web page in the first place - it is a security restriction of the browser. So eval() all you want - it makes no difference in security on the client side from just going to normal javascript enabled websites.</description>
		<content:encoded><![CDATA[<p>Dude, you can only make an XmlHttpRequest to the domain that served you the web page in the first place &#8211; it is a security restriction of the browser. So eval() all you want &#8211; it makes no difference in security on the client side from just going to normal javascript enabled websites.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Fitzgerald</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6288</link>
		<dc:creator>Patrick Fitzgerald</dc:creator>
		<pubDate>Fri, 07 Apr 2006 19:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6288</guid>
		<description>@Jay Sam wrote:

&lt;blockquote cite=&quot;Jay Sam&quot;&gt;When you visit ANY webpage with javascript enabled you are allowing that site to execute arbitrary javascript in your browser - whether you use eval() or not.&lt;/blockquote&gt;

Let&#039;s say you are writing a web app and you fetch some JSON data from another web service, &quot;Joe&#039;s Car Parts&quot;. You fetch the price of a car part, but Joe inserts some additional JavaScript into the response. You eval() the response and Joe&#039;s code runs, does some nasty stuff (in your domain, potentially using your session data).

So if you are fetching JSON data from a source that you don&#039;t trust, you should probably parse it.</description>
		<content:encoded><![CDATA[<p>@Jay Sam wrote:</p>
<blockquote cite="Jay Sam"><p>When you visit ANY webpage with javascript enabled you are allowing that site to execute arbitrary javascript in your browser &#8211; whether you use eval() or not.</p></blockquote>
<p>Let&#8217;s say you are writing a web app and you fetch some JSON data from another web service, &#8220;Joe&#8217;s Car Parts&#8221;. You fetch the price of a car part, but Joe inserts some additional JavaScript into the response. You eval() the response and Joe&#8217;s code runs, does some nasty stuff (in your domain, potentially using your session data).</p>
<p>So if you are fetching JSON data from a source that you don&#8217;t trust, you should probably parse it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Johnson</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6281</link>
		<dc:creator>Dave Johnson</dc:creator>
		<pubDate>Fri, 07 Apr 2006 15:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6281</guid>
		<description>Gabriel, you can do cross domain XML - you just have to do some creative &lt;a href=&quot;http://blogs.ebusiness-apps.com/dave/?p=92&quot; title=&quot;Dave Johnson Cross Domain AJAX&quot; rel=&quot;nofollow&quot;&gt;cross domain ajax&lt;/a&gt; ;)Jay, which ridiculous website is misinformed?IMHO, the most common task when dealing with AJAX is to render data into HTML - so the question is not one of XML vs JSON but XSLT (+XML) vs JavaScript (+JSON). From the &lt;a href=&quot;http://blogs.ebusiness-apps.com/dave/?p=68&quot; title=&quot;Dave Johnson AJAX Benchmarking&quot; rel=&quot;nofollow&quot;&gt;AJAX performance&lt;/a&gt; of these combinations one can determine which to use for a given situation. In &lt;strong&gt;general&lt;/strong&gt; I like to keep state information (active record, highlighted object, selected items - that sort of thing) as JavaScript objects but data from the server in XML.I also wonder why everyone always uses the most complicated and verbose XML + XML DOM code when talking about JSON vs XML? What about XPath goodness?</description>
		<content:encoded><![CDATA[<p>Gabriel, you can do cross domain XML &#8211; you just have to do some creative <a href="http://blogs.ebusiness-apps.com/dave/?p=92" title="Dave Johnson Cross Domain AJAX" rel="nofollow">cross domain ajax</a> ;)Jay, which ridiculous website is misinformed?IMHO, the most common task when dealing with AJAX is to render data into HTML &#8211; so the question is not one of XML vs JSON but XSLT (+XML) vs JavaScript (+JSON). From the <a href="http://blogs.ebusiness-apps.com/dave/?p=68" title="Dave Johnson AJAX Benchmarking" rel="nofollow">AJAX performance</a> of these combinations one can determine which to use for a given situation. In <strong>general</strong> I like to keep state information (active record, highlighted object, selected items &#8211; that sort of thing) as JavaScript objects but data from the server in XML.I also wonder why everyone always uses the most complicated and verbose XML + XML DOM code when talking about JSON vs XML? What about XPath goodness?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6269</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Fri, 07 Apr 2006 11:57:02 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6269</guid>
		<description>I like using JSON.  I primarily work with PHP and although there are plenty of XML packages, there&#039;s still some level of string concatenation, etc to actually build the XML sent via the AJAX request.  Then, in JavaScript, I have to go through the process of traversing the XML and building my javascript object so that I can use it.  Even with relatively large datasets, I find that json-&gt;encode(largearray) and then json.parse(large ajax response) is far easier to implement and creates a negligible affect on server performance.

I fail to see the point of the naysayers here.  JSON is XML without the hassle of XML...I think that&#039;s the point of the article.  Here&#039;s a quote:

&quot;JSON produces slightly smaller documents, and JSON is certainly easier to use in JavaScript&quot;  I think that wins it for me.</description>
		<content:encoded><![CDATA[<p>I like using JSON.  I primarily work with PHP and although there are plenty of XML packages, there&#8217;s still some level of string concatenation, etc to actually build the XML sent via the AJAX request.  Then, in JavaScript, I have to go through the process of traversing the XML and building my javascript object so that I can use it.  Even with relatively large datasets, I find that json-&gt;encode(largearray) and then json.parse(large ajax response) is far easier to implement and creates a negligible affect on server performance.</p>
<p>I fail to see the point of the naysayers here.  JSON is XML without the hassle of XML&#8230;I think that&#8217;s the point of the article.  Here&#8217;s a quote:</p>
<p>&#8220;JSON produces slightly smaller documents, and JSON is certainly easier to use in JavaScript&#8221;  I think that wins it for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Davis</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6267</link>
		<dc:creator>David Davis</dc:creator>
		<pubDate>Fri, 07 Apr 2006 10:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6267</guid>
		<description>Did anyone notice that the article refers to builder.com, but the article is at developer.com

Nothing new and a bit late, don&#039;t you think?</description>
		<content:encoded><![CDATA[<p>Did anyone notice that the article refers to builder.com, but the article is at developer.com</p>
<p>Nothing new and a bit late, don&#8217;t you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay Sam</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6258</link>
		<dc:creator>Jay Sam</dc:creator>
		<pubDate>Fri, 07 Apr 2006 03:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6258</guid>
		<description>The few posters claiming XML is faster than JSON and the ridiculous website &quot;proving&quot; XML is faster are all misinformed. &lt;b&gt;Parsing&lt;/b&gt; XML may be faster than evaluating JSON, but what good is a parsed XML tree unless you actually &lt;b&gt;use&lt;/b&gt; the data - i.e., retrieve it from the DOM tree to convert it to a javascript variable? Once you add the parsing time to the actual use time you will see JSON is a clear speed winner. More to the point, JSON can express maps and arrays much more clearly than XML. In XML all maps and arrays are expressed by convention rather than as part of the data format itself. With JSON there is no chance of misinterpretation.

Unrelated to this, the article mentioned that &quot;a malicious server could have your browsers executing dangerous actions. In that case, you&#039;re better off using a JSON parser written in JavaScript.&quot; They are talking about the javascript eval() command. When you visit ANY webpage with javascript enabled you are allowing that site to execute arbitrary javascript in your browser - whether you use eval() or not. So the browser client may as well allow eval() use since it is no worse than the non-eval() javascript case.  The only place to be concerned about potentially dangerous JSON use is on the &lt;b&gt;server&lt;/b&gt;, and using a JSON parser there would make perfect sense.</description>
		<content:encoded><![CDATA[<p>The few posters claiming XML is faster than JSON and the ridiculous website &#8220;proving&#8221; XML is faster are all misinformed. <b>Parsing</b> XML may be faster than evaluating JSON, but what good is a parsed XML tree unless you actually <b>use</b> the data &#8211; i.e., retrieve it from the DOM tree to convert it to a javascript variable? Once you add the parsing time to the actual use time you will see JSON is a clear speed winner. More to the point, JSON can express maps and arrays much more clearly than XML. In XML all maps and arrays are expressed by convention rather than as part of the data format itself. With JSON there is no chance of misinterpretation.</p>
<p>Unrelated to this, the article mentioned that &#8220;a malicious server could have your browsers executing dangerous actions. In that case, you&#8217;re better off using a JSON parser written in JavaScript.&#8221; They are talking about the javascript eval() command. When you visit ANY webpage with javascript enabled you are allowing that site to execute arbitrary javascript in your browser &#8211; whether you use eval() or not. So the browser client may as well allow eval() use since it is no worse than the non-eval() javascript case.  The only place to be concerned about potentially dangerous JSON use is on the <b>server</b>, and using a JSON parser there would make perfect sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hubris Sonic</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6254</link>
		<dc:creator>Hubris Sonic</dc:creator>
		<pubDate>Fri, 07 Apr 2006 00:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6254</guid>
		<description>JSON maybe elegant, and I think it is. However the title of this post is more than misleading. 

If you are writing a app which does a lot of object creation etc. I can see where JSON would be attractive at least for the cleanliness of the solution. 

But if you are pushing a lot of data back and forth, I think clearly the XML is the way to go. and it has more going for it than just performance.</description>
		<content:encoded><![CDATA[<p>JSON maybe elegant, and I think it is. However the title of this post is more than misleading. </p>
<p>If you are writing a app which does a lot of object creation etc. I can see where JSON would be attractive at least for the cleanliness of the solution. </p>
<p>But if you are pushing a lot of data back and forth, I think clearly the XML is the way to go. and it has more going for it than just performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Plush</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6244</link>
		<dc:creator>Jim Plush</dc:creator>
		<pubDate>Thu, 06 Apr 2006 18:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6244</guid>
		<description>&quot;Screw having the browser parse anything with JavaScript. &quot;

I wish I had the luxury of having a nice fat pipe to serve every client however I don&#039;t so in my particular case I need to minimize network traffic while also allowing 3rd parties to tap into our core system. Rather then have them writing xml strings for complex api calls, they simply need to pass in a javascript object and I can do the rest. 

KISS. You&#039;ll never win a battle of XML vs JSON vs TEXT. Its all about what you need to do to get the job done. If XML works for you then enjoy, if JSON works for you then enjoy. Good programmers will use both in their toolbox if one of them has advantages over the other.</description>
		<content:encoded><![CDATA[<p>&#8220;Screw having the browser parse anything with JavaScript. &#8221;</p>
<p>I wish I had the luxury of having a nice fat pipe to serve every client however I don&#8217;t so in my particular case I need to minimize network traffic while also allowing 3rd parties to tap into our core system. Rather then have them writing xml strings for complex api calls, they simply need to pass in a javascript object and I can do the rest. </p>
<p>KISS. You&#8217;ll never win a battle of XML vs JSON vs TEXT. Its all about what you need to do to get the job done. If XML works for you then enjoy, if JSON works for you then enjoy. Good programmers will use both in their toolbox if one of them has advantages over the other.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Levy</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6243</link>
		<dc:creator>Gabriel Levy</dc:creator>
		<pubDate>Thu, 06 Apr 2006 18:16:43 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6243</guid>
		<description>JSON lends itself to cross-domain data interchange via the dynamic script tag hack. Using XMLHttpRequest and XML, you are limited by the same-domain security policy in most browsers. When implementing remote media library browsing in &lt;a href=&quot;http://www.ajaxamp.com&quot; rel=&quot;nofollow&quot;&gt;AjaxAMP&lt;/a&gt; I was forced to use JSON for this reason since the client must fetch media library information from a user-defined remote IP address. The nice surprise was that it also turned out to be amazingly simple to parse on the client side.</description>
		<content:encoded><![CDATA[<p>JSON lends itself to cross-domain data interchange via the dynamic script tag hack. Using XMLHttpRequest and XML, you are limited by the same-domain security policy in most browsers. When implementing remote media library browsing in <a href="http://www.ajaxamp.com" rel="nofollow">AjaxAMP</a> I was forced to use JSON for this reason since the client must fetch media library information from a user-defined remote IP address. The nice surprise was that it also turned out to be amazingly simple to parse on the client side.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy Murphy</title>
		<link>http://ajaxian.com/archives/speeding-up-ajax-with-json/comment-page-1#comment-6242</link>
		<dc:creator>Guy Murphy</dc:creator>
		<pubDate>Thu, 06 Apr 2006 18:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/speeding-up-ajax-with-json#comment-6242</guid>
		<description>The assertion that JSAN will speed up your web applications is potentially naive. JSON will parse on the client faster, but unless you&#039;re hitting performance problems on the client that plays all of zero weight of concern as to whether your Web application... which is essentially a server application will scale or perform.

*IF* your application is performing ok in the client the question is what will be performant on the *server* in preparing the data.... now that&#039;s not to say preparing JSON on the server to be sent to the client wont be more performant, merely that is what needs considered.

I don&#039;t know about Ruby or PHP, but Java, .NET and Python all have performant XML implementations, and serialising data to XML isn&#039;t a performance concern. It also means your response is potentially reuasable by other clients etc etc.

As for the notion of posting JSON to the server to be parsed for the request... no is the simple answer... it wont be more performant than simply posting a regular query. Not even close. In Java or .NET to reconstruct an object on the server in an ad hoc fashion is going to completely slag performance.

For myself, for descrete value returns, plain text is just fine for the response. For large returns I&#039;ll simply have the application prep XML and transform in server side to a partial view with XSL into HTML and return the whole portion.... if it&#039;s more than a simple value it&#039;s an exercise in transclusion for me, not RPC... I still feel we&#039;re reinventing a wheel that should have been addressed with XLink.... if I need to repopulate a list then I&#039;ll do just that, I&#039;ll pass back the list content to be sqirted in. Screw having the browser parse anything with JavaScript. Take this content, and put it there.

My clients are as dumb as I can keep them bar plumbing and regular mechanic.</description>
		<content:encoded><![CDATA[<p>The assertion that JSAN will speed up your web applications is potentially naive. JSON will parse on the client faster, but unless you&#8217;re hitting performance problems on the client that plays all of zero weight of concern as to whether your Web application&#8230; which is essentially a server application will scale or perform.</p>
<p>*IF* your application is performing ok in the client the question is what will be performant on the *server* in preparing the data&#8230;. now that&#8217;s not to say preparing JSON on the server to be sent to the client wont be more performant, merely that is what needs considered.</p>
<p>I don&#8217;t know about Ruby or PHP, but Java, .NET and Python all have performant XML implementations, and serialising data to XML isn&#8217;t a performance concern. It also means your response is potentially reuasable by other clients etc etc.</p>
<p>As for the notion of posting JSON to the server to be parsed for the request&#8230; no is the simple answer&#8230; it wont be more performant than simply posting a regular query. Not even close. In Java or .NET to reconstruct an object on the server in an ad hoc fashion is going to completely slag performance.</p>
<p>For myself, for descrete value returns, plain text is just fine for the response. For large returns I&#8217;ll simply have the application prep XML and transform in server side to a partial view with XSL into HTML and return the whole portion&#8230;. if it&#8217;s more than a simple value it&#8217;s an exercise in transclusion for me, not RPC&#8230; I still feel we&#8217;re reinventing a wheel that should have been addressed with XLink&#8230;. if I need to repopulate a list then I&#8217;ll do just that, I&#8217;ll pass back the list content to be sqirted in. Screw having the browser parse anything with JavaScript. Take this content, and put it there.</p>
<p>My clients are as dumb as I can keep them bar plumbing and regular mechanic.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
