<?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: Dojo&#8217;s Query System: No, Really, It&#8217;s That Fast</title>
	<atom:link href="http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/feed/" rel="self" type="application/rss+xml" />
	<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/</link>
	<description></description>
	<lastBuildDate>Thu, 09 Feb 2012 21:30:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dojo 1.3b3 Is Out &#124; Continuing Intermittent Incoherency</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-235625</link>
		<dc:creator>Dojo 1.3b3 Is Out &#124; Continuing Intermittent Incoherency</dc:creator>
		<pubDate>Sun, 08 Mar 2009 01:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-235625</guid>
		<description>[...] you may know, Dojo&#8217;s CSS query engine has always been wicked fast. Indeed, our original design target for doing CSS queries was that we wouldn&#8217;t do an engine [...]</description>
		<content:encoded><![CDATA[<p>[...] you may know, Dojo&#8217;s CSS query engine has always been wicked fast. Indeed, our original design target for doing CSS queries was that we wouldn&#8217;t do an engine [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SitePen Blog &#187; Debunking Dojo Toolkit Myths</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-235366</link>
		<dc:creator>SitePen Blog &#187; Debunking Dojo Toolkit Myths</dc:creator>
		<pubDate>Mon, 27 Oct 2008 16:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-235366</guid>
		<description>[...] in Dojo today, and some things are 1000% faster or more. In measuring performance with querying, dojo.query is as fast if not faster than other major leading toolkits with the SlickSpeed test [...]</description>
		<content:encoded><![CDATA[<p>[...] in Dojo today, and some things are 1000% faster or more. In measuring performance with querying, dojo.query is as fast if not faster than other major leading toolkits with the SlickSpeed test [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-235107</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Tue, 02 Sep 2008 23:47:52 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-235107</guid>
		<description>Hey Ray:

So the query compilation is a very big part of it, but fetching previously matched elements is a no-go for reasons of accuracy and a lack of mutation events in browsers. Every JS library worth its salt uses some form of query-to-function builder. Indeed, Dojo&#039;s vanilla engine is a closure-based function accumulator (making it super-hackable) married to a left-to-right term matching core. For browsers which have much faster engines built in, Dojo defers to those engines (be they XPath or querySelectorAll), but keeps a record of the decisions regarding which engine to use (again, via a closure).

I think it would absolutely be great to see some benchmarks which target unique query runs, but the Dojo engine might do &quot;artifically&quot; well here as well since we compile and cache the matchers for sub-expressions as well, allowing us to do even better in the real-world where many queries might differ only by one or two terms. Fundamentally, I think the best benchmarks will be related to queries culled from heavy query users based on real-world DOMs and DOM fragments in a &quot;clean&quot; environment (iframe, most likely).

But the whole point here, I guess, is that while Dojo might totally own on those benchmarks, the time is quickly passing when it will even matter. In fact, I think benchmarketing on this basis is probably already past its due-date. Time to move on to talk about issues of larger-scale application construction and composition (another area where Dojo&#039;s performance and tooling focus pays off in a big way, but that&#039;s another discussion entirely).

Regards</description>
		<content:encoded><![CDATA[<p>Hey Ray:</p>
<p>So the query compilation is a very big part of it, but fetching previously matched elements is a no-go for reasons of accuracy and a lack of mutation events in browsers. Every JS library worth its salt uses some form of query-to-function builder. Indeed, Dojo&#8217;s vanilla engine is a closure-based function accumulator (making it super-hackable) married to a left-to-right term matching core. For browsers which have much faster engines built in, Dojo defers to those engines (be they XPath or querySelectorAll), but keeps a record of the decisions regarding which engine to use (again, via a closure).</p>
<p>I think it would absolutely be great to see some benchmarks which target unique query runs, but the Dojo engine might do &#8220;artifically&#8221; well here as well since we compile and cache the matchers for sub-expressions as well, allowing us to do even better in the real-world where many queries might differ only by one or two terms. Fundamentally, I think the best benchmarks will be related to queries culled from heavy query users based on real-world DOMs and DOM fragments in a &#8220;clean&#8221; environment (iframe, most likely).</p>
<p>But the whole point here, I guess, is that while Dojo might totally own on those benchmarks, the time is quickly passing when it will even matter. In fact, I think benchmarketing on this basis is probably already past its due-date. Time to move on to talk about issues of larger-scale application construction and composition (another area where Dojo&#8217;s performance and tooling focus pays off in a big way, but that&#8217;s another discussion entirely).</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Cromwell</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-235105</link>
		<dc:creator>Ray Cromwell</dc:creator>
		<pubDate>Tue, 02 Sep 2008 22:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-235105</guid>
		<description>I haven&#039;t looked at the specifics of how these speed improvements are being made, but if they are being made through aggressive caching of compiled queries and previously fetched elements, might I suggest an alternative benchmark that focuses on startup time of a page, which could negate some of the cache advantages.

That is, if I&#039;ve gone a ton of disjoint queries, the benchmarks might show great performance if the same query is replayed over and over again, but it could still be the cache that all the selector queries are adding some non-trivial startup time latency, especially if the difference between a query never seen before, and one which is cached, are huge.

Now, I know someone crazy is going to suggest caching these in window.name, cookies, or gears soon. :)</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t looked at the specifics of how these speed improvements are being made, but if they are being made through aggressive caching of compiled queries and previously fetched elements, might I suggest an alternative benchmark that focuses on startup time of a page, which could negate some of the cache advantages.</p>
<p>That is, if I&#8217;ve gone a ton of disjoint queries, the benchmarks might show great performance if the same query is replayed over and over again, but it could still be the cache that all the selector queries are adding some non-trivial startup time latency, especially if the difference between a query never seen before, and one which is cached, are huge.</p>
<p>Now, I know someone crazy is going to suggest caching these in window.name, cookies, or gears soon. <img src='http://infrequently.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Les</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-235003</link>
		<dc:creator>Les</dc:creator>
		<pubDate>Fri, 22 Aug 2008 16:38:54 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-235003</guid>
		<description>Michael:

I&#039;d agree with Alex&#039;s comments.  Also, keep in mind that events bubble and you can reduce the number of event handlers by observing them at the parent/ancestors.</description>
		<content:encoded><![CDATA[<p>Michael:</p>
<p>I&#8217;d agree with Alex&#8217;s comments.  Also, keep in mind that events bubble and you can reduce the number of event handlers by observing them at the parent/ancestors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-235000</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Fri, 22 Aug 2008 05:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-235000</guid>
		<description>Michael:

I&#039;d love to see your test case. I have a strong suspicion that the time to execute the queries wasn&#039;t a blocker (unless the queries weren&#039;t well thought-out) vs. the time to create and apply the function handlers (which includes lots of object alloc and opportunities for overhead creation).

Regards</description>
		<content:encoded><![CDATA[<p>Michael:</p>
<p>I&#8217;d love to see your test case. I have a strong suspicion that the time to execute the queries wasn&#8217;t a blocker (unless the queries weren&#8217;t well thought-out) vs. the time to create and apply the function handlers (which includes lots of object alloc and opportunities for overhead creation).</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Galpin</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-234999</link>
		<dc:creator>Michael Galpin</dc:creator>
		<pubDate>Fri, 22 Aug 2008 05:20:25 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-234999</guid>
		<description>I don&#039;t quite agree. I know that we have had huge problems with performing a number of queries as part of event bindings during page-load. Page load time was unacceptable and we had to switch to inline event binding instead. That made a huge difference. A constant-time query would have made all the difference.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t quite agree. I know that we have had huge problems with performing a number of queries as part of event bindings during page-load. Page load time was unacceptable and we had to switch to inline event binding instead. That made a huge difference. A constant-time query would have made all the difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-234997</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Fri, 22 Aug 2008 01:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-234997</guid>
		<description>John:

Well, it would imply that Dojo would have a bug to fix, in the same sense that it&#039;s a bug that the other libraries haven&#039;t adopted our query engine code. For instance, there&#039;s this:

http://bugs.dojotoolkit.org/ticket/7072

Which affects our Slickspeed results such that Dojo appears to be much slower than some other libraries when in fact it&#039;s just a single (rarely used) selector which is well outside the norm in terms of the performance profile. Omitting that selector, Dojo&#039;s design on the DOM branch of the query engine wins by a handy margin.

Anyway, we&#039;ll gladly agree that query speed isn&#039;t anyone&#039;s bottleneck. Would be great, then, to see libraries not use it as a benchmarketing baseline.

Regards</description>
		<content:encoded><![CDATA[<p>John:</p>
<p>Well, it would imply that Dojo would have a bug to fix, in the same sense that it&#8217;s a bug that the other libraries haven&#8217;t adopted our query engine code. For instance, there&#8217;s this:</p>
<p><a href="http://bugs.dojotoolkit.org/ticket/7072" rel="nofollow">http://bugs.dojotoolkit.org/ticket/7072</a></p>
<p>Which affects our Slickspeed results such that Dojo appears to be much slower than some other libraries when in fact it&#8217;s just a single (rarely used) selector which is well outside the norm in terms of the performance profile. Omitting that selector, Dojo&#8217;s design on the DOM branch of the query engine wins by a handy margin.</p>
<p>Anyway, we&#8217;ll gladly agree that query speed isn&#8217;t anyone&#8217;s bottleneck. Would be great, then, to see libraries not use it as a benchmarketing baseline.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Resig</title>
		<link>http://infrequently.org/2008/08/dojos-query-system-no-really-its-that-fast/comment-page-1/#comment-234996</link>
		<dc:creator>John Resig</dc:creator>
		<pubDate>Fri, 22 Aug 2008 01:48:18 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=743#comment-234996</guid>
		<description>&quot;...although there’s really no reason why your query engine of choice should be twice as slow as Dojo’s...&quot;

Wouldn&#039;t that imply, then, that if Dojo&#039;s query engine was twice as slow as another engine, at the same metrics, there wouldn&#039;t be much reason for using Dojo, would there?

&quot;Now that we’re all fast enough&quot;

I&#039;d agree that selector engines are rapidly approaching a solid level (especially with the Selectors API in play) - but that&#039;s a very tiny aspect of most web applications. In our &quot;in-the-wild&quot; profiling we&#039;ve found that DOM manipulation and construction still consume the vast majority of page rendering time. Libraries are definitely not out of the woods yet when it comes to pure-JavaScript/DOM library performance.</description>
		<content:encoded><![CDATA[<p>&#8220;&#8230;although there’s really no reason why your query engine of choice should be twice as slow as Dojo’s&#8230;&#8221;</p>
<p>Wouldn&#8217;t that imply, then, that if Dojo&#8217;s query engine was twice as slow as another engine, at the same metrics, there wouldn&#8217;t be much reason for using Dojo, would there?</p>
<p>&#8220;Now that we’re all fast enough&#8221;</p>
<p>I&#8217;d agree that selector engines are rapidly approaching a solid level (especially with the Selectors API in play) &#8211; but that&#8217;s a very tiny aspect of most web applications. In our &#8220;in-the-wild&#8221; profiling we&#8217;ve found that DOM manipulation and construction still consume the vast majority of page rendering time. Libraries are definitely not out of the woods yet when it comes to pure-JavaScript/DOM library performance.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

