J
jdalton
David,
do *not* have QSA.
to put an effort into it.
Here is what I found:
(I am not counting the try-catch as a bug check because all have that)
My Library QSA addon has 0 QSA bug checks
YUI 3.0.0 has 0 QSA bug checks that I could find
MooTools 1.2.4 doesn't use QSA
Prototype 1.6.1 (next release they are switching to Sizzle)
WebKit className issue line #3217
Context check line #3293
Sizzle 1.0 (Used in jQuery):
WebKit className issue
http://github.com/jeresig/sizzle/blob/master/sizzle.js#L894
Avoid QSA on non HTML elements
http://github.com/jeresig/sizzle/blob/master/sizzle.js#L903
Avoid issues when .length of a nodeList maybe an element
http://github.com/jeresig/sizzle/blob/master/sizzle.js#L724
jQuery 1.4.1 (in addition to the Sizzle checks)
Avoids QSA for simple id selector line #121
Avoids QSA for simple tagName selector line #142
Dojo 1.4.0
Starting with combinator check line #9240
IE pseudos selector check line #9244
className case bug line #9246
Avoids `:contains` and `:checked` line #9255
Avoids attribute selector `|=` line #9256
Converts to a dojo.NodeList #9583
NWMatcher 1.2.1 (line numbers range from 233 - 302)
className should be case-sensitive in quirksMode (draft spec)
`:enabled` and `:disabled` bugs with hidden fields (Firefox 3.5
QSA bug)
IE8 throws errors with some pseudos
`:checked` bugs with checkbox fields (Opera 10beta3 bug)
link bugs with hyperlinks matching (Firefox/Safari)
Attribute bugs with isMap, checked, disabled, multiple, readonly,
selected
Avoid QSA for simple id, className and possibly tagName selectors
Avoid issues when .length of a nodeList maybe an element line
#1206
I am not debating the quality of there checks but I am saying they at
least attempt to check for inconsistencies/bugs.
I believe your Slickspeed results aren't very useful because it only
averages the time it takes to execute a method call 4 times per test
which results in a lot of useless 0ms returns.
So I used a modified version of Slickspeed which tests the max number
of executions a function can perform in a given time period (in this
case 200ms to start, later after Richard's review, I bumped it to
400ms).
At first I used a version of your My Library from your builder (just
the dom+query module) and then later, after you mentioned your builder
produced outdated code, I switched to the version from your download
page.
(both *without* your QSA addon because I take issue with it)
To be fair I then posted results from a range of browsers (most did
not support QSA) and marked your score with an asterisk.
The results re-posted here for context.
Win XP (mylib.js from your builder using just the DOM query modules)
-----
IE 7.0.5730.11
32 51 21 39* 73 59 26
IE 6.0.2900.5122.xpsp_sp3.gdr.080814-1236
30 50 20 38* 75 59 26
IE 8.0.6001.18702 (Compatibility View)
56 91 33 72* 216 108 62
Opera 9.50 (build 10063)
160 150 55 68* 339 170 128
WinXP (using mylib-min.js from your download page)
-----
Opera 9.25
49 81 29 40* 151 90 42
Opera 9.50
159 146 57 112* 347 173 123
Opera 9.64
127 127 47 98* 316 143 108
Opera 10.10
201 352 62 109* 554 426 368
Chrome 1.0.154.36
252 407 139 279* 849 476 448
Chrome 2.0.172.28
267 615 144 335* 1499 830 716
Chrome 3.0.195.21
350 946 161 114* 2160 1333 970
IE6
29 47 18 35* 69 60 24
IE8 (Compatibility View)
61 97 38 81* 234 117 64
Firefox 3.6
244 305 188 99* 922 354 318
OSX 10.4
--------
Safari 2.0.0
1 0 9 1* 10 5 0
Safari 2.0.4
2 0 2 3* 15 0 2
Safari 3.04
17 20 13 15* 54 24 16
Safari 3.1
177 302 84 124* 562 387 362
Firefox 2.0
7 12 7 7* 28 14 7
Richard Cornford then reviewed my Slickspeed internals and made some
suggestions (none of which changed the overall result trend)
As per Richards's review I increased the sample time from 200ms to
400ms and made it display the straight execution count in the results.
IE8 (Compatibility Mode)
5,958 8,362 3,238 5,681* 17,768 8,630 3,499
Opera 9.25
7,675 13,137 4,688 6,599* 25,826 14,941 6,620
Opera 9.50
33,643 31,268 11,725 24,128* 71,395 36,086 27,150
Safari 3.0.4
2,715 2,561 2,333 2,325* 8,794 3,787 2,547
Out of the 23 results posted I believe 5 used QSA.
In many of the results `My Library` was one of the slowest libs tested
(though in some it was middle of the road or better)
I apologize for any impression that I was trying to mislead people. I
have added a note to the Slickspeed stating MyLib is without the QSA
addon.
I would like to try to keep the dialog from turning into a flame war
and avoid name calling/personal attacks.
(I certainly contributed to the first round of dialogs spiraling into
flame bait and would like to avoid it again)
I am not cheerleading any major framework and really only raised an
issue with your results because of how abusive, warranted or not, I
think you are toward other frameworks/developers. I hope my test
results are useful to you and help you fine-tune your approach.
I not posting as anyone else.LOL. It's the same guy (gal?) over and over. They just keep changing
their name to make it look like they are an army.
That is wrong. The majority of browsers I reported (18 of 23 results)There was a bogus test posted that excluded my QSA add-on (without
noting the fact) and then asserted My Library was "one of the slowest"
because QSA out-performed it.
do *not* have QSA.
I didn't say "great lengths to ensure", I said at least they attemptedThis was ostensibly because the other
libraries had gone to great lengths to ensure their QSA tack-ons were
consistent cross-browser.
to put an effort into it.
Here is what I found:
(I am not counting the try-catch as a bug check because all have that)
My Library QSA addon has 0 QSA bug checks
YUI 3.0.0 has 0 QSA bug checks that I could find
MooTools 1.2.4 doesn't use QSA
Prototype 1.6.1 (next release they are switching to Sizzle)
WebKit className issue line #3217
Context check line #3293
Sizzle 1.0 (Used in jQuery):
WebKit className issue
http://github.com/jeresig/sizzle/blob/master/sizzle.js#L894
Avoid QSA on non HTML elements
http://github.com/jeresig/sizzle/blob/master/sizzle.js#L903
Avoid issues when .length of a nodeList maybe an element
http://github.com/jeresig/sizzle/blob/master/sizzle.js#L724
jQuery 1.4.1 (in addition to the Sizzle checks)
Avoids QSA for simple id selector line #121
Avoids QSA for simple tagName selector line #142
Dojo 1.4.0
Starting with combinator check line #9240
IE pseudos selector check line #9244
className case bug line #9246
Avoids `:contains` and `:checked` line #9255
Avoids attribute selector `|=` line #9256
Converts to a dojo.NodeList #9583
NWMatcher 1.2.1 (line numbers range from 233 - 302)
className should be case-sensitive in quirksMode (draft spec)
`:enabled` and `:disabled` bugs with hidden fields (Firefox 3.5
QSA bug)
IE8 throws errors with some pseudos
`:checked` bugs with checkbox fields (Opera 10beta3 bug)
link bugs with hyperlinks matching (Firefox/Safari)
Attribute bugs with isMap, checked, disabled, multiple, readonly,
selected
Avoid QSA for simple id, className and possibly tagName selectors
Avoid issues when .length of a nodeList maybe an element line
#1206
I am not debating the quality of there checks but I am saying they at
least attempt to check for inconsistencies/bugs.
I believe your Slickspeed results aren't very useful because it only
averages the time it takes to execute a method call 4 times per test
which results in a lot of useless 0ms returns.
So I used a modified version of Slickspeed which tests the max number
of executions a function can perform in a given time period (in this
case 200ms to start, later after Richard's review, I bumped it to
400ms).
At first I used a version of your My Library from your builder (just
the dom+query module) and then later, after you mentioned your builder
produced outdated code, I switched to the version from your download
page.
(both *without* your QSA addon because I take issue with it)
To be fair I then posted results from a range of browsers (most did
not support QSA) and marked your score with an asterisk.
The results re-posted here for context.
Win XP (mylib.js from your builder using just the DOM query modules)
-----
IE 7.0.5730.11
32 51 21 39* 73 59 26
IE 6.0.2900.5122.xpsp_sp3.gdr.080814-1236
30 50 20 38* 75 59 26
IE 8.0.6001.18702 (Compatibility View)
56 91 33 72* 216 108 62
Opera 9.50 (build 10063)
160 150 55 68* 339 170 128
WinXP (using mylib-min.js from your download page)
-----
Opera 9.25
49 81 29 40* 151 90 42
Opera 9.50
159 146 57 112* 347 173 123
Opera 9.64
127 127 47 98* 316 143 108
Opera 10.10
201 352 62 109* 554 426 368
Chrome 1.0.154.36
252 407 139 279* 849 476 448
Chrome 2.0.172.28
267 615 144 335* 1499 830 716
Chrome 3.0.195.21
350 946 161 114* 2160 1333 970
IE6
29 47 18 35* 69 60 24
IE8 (Compatibility View)
61 97 38 81* 234 117 64
Firefox 3.6
244 305 188 99* 922 354 318
OSX 10.4
--------
Safari 2.0.0
1 0 9 1* 10 5 0
Safari 2.0.4
2 0 2 3* 15 0 2
Safari 3.04
17 20 13 15* 54 24 16
Safari 3.1
177 302 84 124* 562 387 362
Firefox 2.0
7 12 7 7* 28 14 7
Richard Cornford then reviewed my Slickspeed internals and made some
suggestions (none of which changed the overall result trend)
As per Richards's review I increased the sample time from 200ms to
400ms and made it display the straight execution count in the results.
IE8 (Compatibility Mode)
5,958 8,362 3,238 5,681* 17,768 8,630 3,499
Opera 9.25
7,675 13,137 4,688 6,599* 25,826 14,941 6,620
Opera 9.50
33,643 31,268 11,725 24,128* 71,395 36,086 27,150
Safari 3.0.4
2,715 2,561 2,333 2,325* 8,794 3,787 2,547
Out of the 23 results posted I believe 5 used QSA.
In many of the results `My Library` was one of the slowest libs tested
(though in some it was middle of the road or better)
I apologize for any impression that I was trying to mislead people. I
have added a note to the Slickspeed stating MyLib is without the QSA
addon.
I would like to try to keep the dialog from turning into a flame war
and avoid name calling/personal attacks.
(I certainly contributed to the first round of dialogs spiraling into
flame bait and would like to avoid it again)
I am not cheerleading any major framework and really only raised an
issue with your results because of how abusive, warranted or not, I
think you are toward other frameworks/developers. I hope my test
results are useful to you and help you fine-tune your approach.