<?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: Sizzle: John Resig has a new selector engine</title>
	<atom:link href="http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: Remedies</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-269625</link>
		<dc:creator>Remedies</dc:creator>
		<pubDate>Mon, 08 Dec 2008 18:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-269625</guid>
		<description>Sizzle - great name but lets see it......</description>
		<content:encoded><![CDATA[<p>Sizzle &#8211; great name but lets see it&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Hartmann</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266919</link>
		<dc:creator>Jon Hartmann</dc:creator>
		<pubDate>Tue, 26 Aug 2008 12:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266919</guid>
		<description>I&#039;d love to see the Sizzle code updated with more comments. I know that for the people that are &quot;up&quot; on making these sort of things some of this might make perfect sense, but I&#039;m getting lost trying to follow it. I do love getting to see code like this though!</description>
		<content:encoded><![CDATA[<p>I&#8217;d love to see the Sizzle code updated with more comments. I know that for the people that are &#8220;up&#8221; on making these sort of things some of this might make perfect sense, but I&#8217;m getting lost trying to follow it. I do love getting to see code like this though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266912</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Mon, 25 Aug 2008 21:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266912</guid>
		<description>As mentioned, it&#039;s client side sniffing. I personally think that the negativity surrounding browser sniffing has been taken too far, too religiously. There are cases where feature detection falls flat, and the &quot;fix&quot;, which is to run a battery of unit tests to prove a particular feature adheres to its specification I think is too wasteful of client and network resources. I don&#039;t like getting too religious over design choices, I like what works, and what works efficiently, for my needs.

In any case, GWT can do either browser sniffing or feature detection, it&#039;s up to you. For example, gwtquery contains some sample code which does &quot;getElementsByClassName&quot; feature detection, with the option of compiling different code paths that include it. 

I think what might be confusing you is the notion of compile-time (happens not on client) vs client-side sniffing. GWT compiles multiple versions of your application up front, and the based on a small bootstrap script which performs the sniffing, it loads up the correctly compiled version.

Thus, I can create two implementions of a find() function. One that uses querySelectorAll, and one that used XPath. GWT will compile the application twice, once with the first function linked on, the second with the second function linked in. It then autogenerates a small selection script which gets document.querySelectorAll or document.evaluate and loads the appropriately compiled app. All of this is done on the client side. It produces very compact code with very fast startup time, and it doesn&#039;t require futzing around with complex concat scripts, packers, and minifiers, to figure out what to include and what to leave out.</description>
		<content:encoded><![CDATA[<p>As mentioned, it&#8217;s client side sniffing. I personally think that the negativity surrounding browser sniffing has been taken too far, too religiously. There are cases where feature detection falls flat, and the &#8220;fix&#8221;, which is to run a battery of unit tests to prove a particular feature adheres to its specification I think is too wasteful of client and network resources. I don&#8217;t like getting too religious over design choices, I like what works, and what works efficiently, for my needs.</p>
<p>In any case, GWT can do either browser sniffing or feature detection, it&#8217;s up to you. For example, gwtquery contains some sample code which does &#8220;getElementsByClassName&#8221; feature detection, with the option of compiling different code paths that include it. </p>
<p>I think what might be confusing you is the notion of compile-time (happens not on client) vs client-side sniffing. GWT compiles multiple versions of your application up front, and the based on a small bootstrap script which performs the sniffing, it loads up the correctly compiled version.</p>
<p>Thus, I can create two implementions of a find() function. One that uses querySelectorAll, and one that used XPath. GWT will compile the application twice, once with the first function linked on, the second with the second function linked in. It then autogenerates a small selection script which gets document.querySelectorAll or document.evaluate and loads the appropriately compiled app. All of this is done on the client side. It produces very compact code with very fast startup time, and it doesn&#8217;t require futzing around with complex concat scripts, packers, and minifiers, to figure out what to include and what to leave out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nosredna</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266910</link>
		<dc:creator>Nosredna</dc:creator>
		<pubDate>Mon, 25 Aug 2008 20:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266910</guid>
		<description>p01,

I haven&#039;t looked at the latest jQuery, but as of 1.2.3, I think it checked jQuery.browser.msie over twenty times, and that flag is set based on what navigator.userAgent says. It&#039;s possible 1.2.6 has changed that.

I&#039;ve not looked at the sizzle source code yet to see what&#039;s going on there, but then again, I don&#039;t see the point of looking until it supports IE.</description>
		<content:encoded><![CDATA[<p>p01,</p>
<p>I haven&#8217;t looked at the latest jQuery, but as of 1.2.3, I think it checked jQuery.browser.msie over twenty times, and that flag is set based on what navigator.userAgent says. It&#8217;s possible 1.2.6 has changed that.</p>
<p>I&#8217;ve not looked at the sizzle source code yet to see what&#8217;s going on there, but then again, I don&#8217;t see the point of looking until it supports IE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: p01</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266907</link>
		<dc:creator>p01</dc:creator>
		<pubDate>Mon, 25 Aug 2008 19:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266907</guid>
		<description>mmh ... I might have overlooked something then. I was fiddling with other things. I&#039;ll try to watch the talk again as I don&#039;t remember any mention about the sniffing being done on client side, nor of a feature detection mechanism.

 Thanks for the heads up.</description>
		<content:encoded><![CDATA[<p>mmh &#8230; I might have overlooked something then. I was fiddling with other things. I&#8217;ll try to watch the talk again as I don&#8217;t remember any mention about the sniffing being done on client side, nor of a feature detection mechanism.</p>
<p> Thanks for the heads up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andytesti</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266906</link>
		<dc:creator>andytesti</dc:creator>
		<pubDate>Mon, 25 Aug 2008 19:16:43 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266906</guid>
		<description>@p01: I suggest you take a review at the Ray&#039;s talk. GWT performs CLIENT SIDE user agent sniffing.</description>
		<content:encoded><![CDATA[<p>@p01: I suggest you take a review at the Ray&#8217;s talk. GWT performs CLIENT SIDE user agent sniffing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: p01</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266904</link>
		<dc:creator>p01</dc:creator>
		<pubDate>Mon, 25 Aug 2008 18:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266904</guid>
		<description>&lt;strong&gt;cromwellian:&lt;/strong&gt; I recently saw your talk about GWT and GWTQuery. It sure look fast and all but server side UA sniffing screams 1997 to me. I&#039;d rather serve John&#039;s whooping 4kb library that gets the job done right and fast by doing proper client side feature detection than gamble and risk to serve a sub-optimal code path to cloaked user agents or UAs not listed correctly in GWTQuery&#039;s sniffing mechanism.</description>
		<content:encoded><![CDATA[<p><strong>cromwellian:</strong> I recently saw your talk about GWT and GWTQuery. It sure look fast and all but server side UA sniffing screams 1997 to me. I&#8217;d rather serve John&#8217;s whooping 4kb library that gets the job done right and fast by doing proper client side feature detection than gamble and risk to serve a sub-optimal code path to cloaked user agents or UAs not listed correctly in GWTQuery&#8217;s sniffing mechanism.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266903</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Mon, 25 Aug 2008 18:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266903</guid>
		<description>And I hope one day IE will just go away. :)</description>
		<content:encoded><![CDATA[<p>And I hope one day IE will just go away. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nosredna</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266902</link>
		<dc:creator>Nosredna</dc:creator>
		<pubDate>Mon, 25 Aug 2008 17:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266902</guid>
		<description>I hope the speed is still there after John addresses the IE challenges.</description>
		<content:encoded><![CDATA[<p>I hope the speed is still there after John addresses the IE challenges.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tj111</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266900</link>
		<dc:creator>tj111</dc:creator>
		<pubDate>Mon, 25 Aug 2008 14:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266900</guid>
		<description>@JamesCurran: Works fine for me,  maybe your DNS  cache is poisoned &#124;o_0&#124; .</description>
		<content:encoded><![CDATA[<p>@JamesCurran: Works fine for me,  maybe your DNS  cache is poisoned |o_0| .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JamesCurran</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266896</link>
		<dc:creator>JamesCurran</dc:creator>
		<pubDate>Mon, 25 Aug 2008 13:38:41 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266896</guid>
		<description>Has anyone else been able to view the code from the given link (http://github.com/jeresig/sizzle/tree/master/sizzle.js).  It seems that there is some embedded link at the bottom, which causes a reset, and both FF and IE would rather display the error message than the 99% of the page that downloaded.</description>
		<content:encoded><![CDATA[<p>Has anyone else been able to view the code from the given link (<a href="http://github.com/jeresig/sizzle/tree/master/sizzle.js" rel="nofollow">http://github.com/jeresig/sizzle/tree/master/sizzle.js</a>).  It seems that there is some embedded link at the bottom, which causes a reset, and both FF and IE would rather display the error message than the 99% of the page that downloaded.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TNO</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266894</link>
		<dc:creator>TNO</dc:creator>
		<pubDate>Mon, 25 Aug 2008 12:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266894</guid>
		<description>double hyphen is a SQL comment..probably paranoid</description>
		<content:encoded><![CDATA[<p>double hyphen is a SQL comment..probably paranoid</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266891</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Mon, 25 Aug 2008 10:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266891</guid>
		<description>Hmm the &quot;-&quot; part is supposed to be TWO hyphens (-)
I don&#039;t know why but ajaxian.com keeps stripping my code ;)</description>
		<content:encoded><![CDATA[<p>Hmm the &#8220;-&#8221; part is supposed to be TWO hyphens (-)<br />
I don&#8217;t know why but ajaxian.com keeps stripping my code ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266890</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Mon, 25 Aug 2008 10:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266890</guid>
		<description>Opps...
while(--i)
I meant of course ;)</description>
		<content:encoded><![CDATA[<p>Opps&#8230;<br />
while(&#8211;i)<br />
I meant of course ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266889</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Mon, 25 Aug 2008 10:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266889</guid>
		<description>@user24
I assume you mean something like this;
var i = someArray.length;
while(--i) {
  /*...do stuff*/
}
...which is &quot;proved&quot; to be the faster solution, though none of those &quot;extreme optimalizations&quot; will matter very much when all browsers are running JS as JIT code. Just as most people stopped unrolling loops when moving from ASM to C since updated processors. But until then the above will perform better than most other loops (and in fact also be smaller ;)</description>
		<content:encoded><![CDATA[<p>@user24<br />
I assume you mean something like this;<br />
var i = someArray.length;<br />
while(&#8211;i) {<br />
  /*&#8230;do stuff*/<br />
}<br />
&#8230;which is &#8220;proved&#8221; to be the faster solution, though none of those &#8220;extreme optimalizations&#8221; will matter very much when all browsers are running JS as JIT code. Just as most people stopped unrolling loops when moving from ASM to C since updated processors. But until then the above will perform better than most other loops (and in fact also be smaller ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: user24</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266887</link>
		<dc:creator>user24</dc:creator>
		<pubDate>Mon, 25 Aug 2008 09:44:23 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266887</guid>
		<description>ah, you&#039;re stripping everything between chevrons, oops.

&quot;for i = 1 to 10&quot; is slower than &quot;for i=10 to 1&quot; is what I was saying ;)</description>
		<content:encoded><![CDATA[<p>ah, you&#8217;re stripping everything between chevrons, oops.</p>
<p>&#8220;for i = 1 to 10&#8243; is slower than &#8220;for i=10 to 1&#8243; is what I was saying ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: user24</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266885</link>
		<dc:creator>user24</dc:creator>
		<pubDate>Mon, 25 Aug 2008 09:42:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266885</guid>
		<description>It&#039;s been known for some time that writing a loop like this:

for(i=0 ; i=0 ; i--)

I know that for small bounds it&#039;s not going to make a noticeable difference, but still, I wonder why everyone isn&#039;t writing their loops backwards like this as a matter of course?</description>
		<content:encoded><![CDATA[<p>It&#8217;s been known for some time that writing a loop like this:</p>
<p>for(i=0 ; i=0 ; i&#8211;)</p>
<p>I know that for small bounds it&#8217;s not going to make a noticeable difference, but still, I wonder why everyone isn&#8217;t writing their loops backwards like this as a matter of course?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266884</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Mon, 25 Aug 2008 08:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266884</guid>
		<description>What&#039;s not hard? Beating jQuery? The current selector libraries are fairly well tuned and hand optimized (e.g. DOMAssistant), so eeking out additional performance across very difference browser JS engines is not straightforward, but requires constantly profiling and tweaking. For example, many of the pseudo-element routines in various libraries appear to be nearly optimal, essentially DOM-call limited.

Speeding up the parser helps, but it produces somewhat misleading benchmarks, since by caching the parsed query, and tossing out the slowest result, you end up only benchmarking the evaluator, but most selector user code doesn&#039;t run these queries dozens or hundreds of times.

Most the rest of the speedup in various libraries seems to come from aggressively caching snippets of queries to avoid expensive DOM calls.</description>
		<content:encoded><![CDATA[<p>What&#8217;s not hard? Beating jQuery? The current selector libraries are fairly well tuned and hand optimized (e.g. DOMAssistant), so eeking out additional performance across very difference browser JS engines is not straightforward, but requires constantly profiling and tweaking. For example, many of the pseudo-element routines in various libraries appear to be nearly optimal, essentially DOM-call limited.</p>
<p>Speeding up the parser helps, but it produces somewhat misleading benchmarks, since by caching the parsed query, and tossing out the slowest result, you end up only benchmarking the evaluator, but most selector user code doesn&#8217;t run these queries dozens or hundreds of times.</p>
<p>Most the rest of the speedup in various libraries seems to come from aggressively caching snippets of queries to avoid expensive DOM calls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Bergkvist</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266883</link>
		<dc:creator>Mikael Bergkvist</dc:creator>
		<pubDate>Mon, 25 Aug 2008 08:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266883</guid>
		<description>Not that it&#039;s that hard though..</description>
		<content:encoded><![CDATA[<p>Not that it&#8217;s that hard though..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/sizzle-john-resig-has-a-new-selector-engine/comment-page-1#comment-266882</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Mon, 25 Aug 2008 06:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=4199#comment-266882</guid>
		<description>Shameless plug :),  GwtQuery, a selector engine written in GWT, is also ~2x=4x faster on most selectors than the old JQuery engine (see benchmark: http://gwtquery.googlecode.com/svn/trunk/demos/gwtquery.samples.GwtQueryBench/GwtQueryBench.html), supports querySelectorAll, getElementsByClassName, document.evaluate, and raw DOM ops. 

It can get impressive speedups and side reductions if you choose to use compile-time selectors. There are parsed and translated before your code is downloaded from the server, and only the code needed to evaluate them is shipped, or in the case of querySelectorAll supporting browsers, no evaluation code is needed.</description>
		<content:encoded><![CDATA[<p>Shameless plug :),  GwtQuery, a selector engine written in GWT, is also ~2x=4x faster on most selectors than the old JQuery engine (see benchmark: <a href="http://gwtquery.googlecode.com/svn/trunk/demos/gwtquery.samples.GwtQueryBench/GwtQueryBench.html" rel="nofollow">http://gwtquery.googlecode.com/svn/trunk/demos/gwtquery.samples.GwtQueryBench/GwtQueryBench.html</a>), supports querySelectorAll, getElementsByClassName, document.evaluate, and raw DOM ops. </p>
<p>It can get impressive speedups and side reductions if you choose to use compile-time selectors. There are parsed and translated before your code is downloaded from the server, and only the code needed to evaluate them is shipped, or in the case of querySelectorAll supporting browsers, no evaluation code is needed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

