D
David Mark
Scott said:I would definitely prefer not to mess with the list of selectors,
unless it's to add some weighing scheme based upon real-world selector
usage. I didn't write the list; it's the one that was in the early
versions of SlickSpeed and has been copied into many other versions.
If you want to host an altered version, as I said:
Changing selectors is very easy. There is a text file in the
distribution -- "selectors.list" -- containing one selector per line.
(If you don't have a PHP host available, I'm willing to post a version
with the selectors you choose.) The mechanism to deal with
unavailable selectors is naive, perhaps, but does it's job well
enough: it simply highlights every row where the number of results
vary between libraries, and highlights any individual test that throws
an error. Intentionally or not, the appearance of SlickSpeed did help
coalesce the minimum set of selectors libraries tended to support.
That's a good thing for developers looking to use one or the other.
Well this is a test of selector speed. I haven't seen the other
libraries having problems with the attribute-based selectors. I know
there are other significant errors with other parts of attribute
handling.
LOL. That's because you didn't have near a large enough sample set.
See my latest SlickSpeed tests:-
http://www.cinsoft.net/slickspeed.html
....and realize that these things are easy to predict if you have read my
reviews of the various "majors".
The even/odd discrepancy, which did not show up in my (obviouslyBut in none was it the overall fastest. JQuery was the fastest in
everything but IE6, where it came in third behind Dojo and MooTools.
In many browsers, if two of the selectors were optimized to match the
speed of the competition, My Library (QSA) would have been about the
fastest overall library. Those were the two selectors with
":contains": "h1[id]:contains(Selectors)" and
"p:contains(selectors)". In the various IE's there was a different
issue, "p:nth-child(even/odd)" were wrong in both versions of My
Library, and were significantly slower, too.
incomplete) testing is a legitimate beef. Apparently I managed to make
those both slow and incorrect. It can happen. I'll grab your test page
as an example and fix it when I get a chance. Will also announce that
those two are broken in my forum. As far as I am concerned, the results
are disqualified until those two are fixed.
That's an odd statement. The results still stand.
You didn't understand. I am throwing out results that were _positive_
because I don't consider them valid unless _all_ tests pass.
They have to do
with the code that was available on the day they ran. As things are
fixed and new tests are released, there will be new results. But
MooTools can't disqualify the results because they haven't yet gotten
around to optimizing "tag.class", Nor can you.
You misunderstood what I was saying. It was the exact _opposite_ of an
excuse.
I don't find much practical use for the general "A n + B" syntax, but
the even/odd "2n"/"2n + 1" selectors have been quite helpful to me.
I added those a few days back.
Almost anytime I use selector engines, though, I find myself using
":not" a fair bit. Obviously it's up to you what you want to support,
but I'd urge you to reconsider.
Why would you need to negate? I'll consider it.
I'm surprised the native QSA engines aren't faster at these,
especially at "#id". If an external library can do a quick switch to
getElementById, you'd think the native engines could also do this in
order to speed things up.
Yes.
I'm curious as to why you (and others here, I've noted) say this.
I've found queries to be an incredibly useful tool, especially for
dynamic pages. What is the objection?
The objection is that it takes something that is 100% reliable (e.g. DOM
host methods like gEBI and gEBTN) and makes it a crap shoot, even in the
very latest version of the major desktop browsers. See my latest
SlickSpeed test page. It's a horror show and only scratching the
surface. This is not how cross-browser scripting is done. It is just
impossible to write reliable cross-browser scripts if every line has to
rely on the kindness of JS library developers and their wacky selector
engines.
It is more compelling, but more subject to manipulation, I'm afraid.
Yeah, like YUI using delegation instead of attaching 100 listeners.
They still lost by a mile.
Still it's worth pursuing, as long as we keep in mind that speed is
only one of a number of important concerns.
Yeah, the other huge concern is most of those columns are results based
on browser sniffing. Are you familiar with the mechanical Turk? Same
sort of thing, except it isn't just one midget, but a small army of
mental midgets who are feverishly trying to keep up with the very latest
browsers (and to hell with everything else), logging observations,
twiddling with the design, adding forks, etc. That's what I mean by
"test-driven" development. Cross-browser scripting doesn't work like
_that_ either.