From: Scott Sauyet on
On Jan 27, 12:09 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
> TaskSpeed is another quasi-standard test that has never seen anything
> like My Library. :) It was written by one of the Dojo guys. Yeah, I
> know. :(
>
> http://www.cinsoft.net/mylib-testspeed.html
>
> It just flat-out murders the rest (even Dojo) And yes, the test
> functions are _very_ concise (even too concise). And no, they aren't
> even close to optimized. They even use the (optional) OO interface.
> So there's really nothing left to argue as My Library is somehow
> (much) faster _and_ more concise. Not to mention compatible with
> virtually any agent, past, present or future. ;)

My results don't agree. I've posted another version, which restricts
the comparison to the latest versions of the libraries from your list,
upgrading to the latest version of jQuery and MooTools. (I couldn't
find test files for more recent versions of YUI or qooxdoo; the others
were already at the latest, I believe.) I ran the tests on a modern
Windows XP SP2 machine with dual 3.0GHz CPUs and 3.25 GB of RAM.

While My Library here performs well, it's far from murdering the
competition.

My tests are at:

http://scott.sauyet.com/Javascript/Test/taskspeed/2010-01-27a/

My results are here:

http://scott.sauyet.com/Javascript/Test/taskspeed/2010-01-27a/results/

I will duplicate those results as an ASCII table below.

Among the seven libraries tested, my results rank My Library as second
fastest in Chrome, third in Firefox, fourth in IE, second in Opera,
and first in Safari (here beating even the "Pure DOM" solution by over
30%!) These are good results, no doubt, but not a runaway win. If
any library can claim to be fastest from my tests, it's definitely
qooxdoo, which was the fastest in four of the five browsers, and
outperformed the "Pure Dom" tests in three of them.

I first tried testing against a version of My Library that I
downloaded January 22. Many of the tests failed. Has the API changed
so drastically in the last few days?

-- Scott


Results (ASCII table, useful mainly with fixed-width font)
==========================================================

Browsers:
---------
Chrome 3.0.195.27
Firefox 3.5.7
IE 8
Opera 9.64
Safari 4.0.3

+--------+--------+--------+--------+--------+
| Chrome | Firefox| IE | Opera | Safari |
+-------------------+--------+--------+--------+--------+--------+
| Pure Dom | 206 | 290 | 906 | 219 | 224 |
+-------------------+--------+--------+--------+--------+--------+
| Dojo 1.4.0 | 225 | 428 | 2018 | 309 | 202 |
+-------------------+--------+--------+--------+--------+--------+
| jQuery 1.4.0 | 458 | 937 | 2922 | 484 | 388 |
+-------------------+--------+--------+--------+--------+--------+
| MooTools 1.2.4 | 304 | 851 | 5686 | 642 | 244 |
+-------------------+--------+--------+--------+--------+--------+
| Prototype 1.6.0.3 | 405 | 1105 | 4529 | 920 | 353 |
+-------------------+--------+--------+--------+--------+--------+
| qooxdoo 0.8.2 | 160 | 406 | 1593 | 217 | 218 |
+-------------------+--------+--------+--------+--------+--------+
| YUI 2.7.0 | 299 | 866 | 2172 | 439 | 317 |
+-------------------+--------+--------+--------+--------+--------+
| My Library (QSA) | 167 | 447 | 2642 | 269 | 155 |
+-------------------+--------+--------+--------+--------+--------+

From: David Mark on
On Jan 27, 2:32 pm, jdalton <john.david.dal...(a)gmail.com> wrote:
> Hi David,
>
> Taskspeed is standardized by Peter Higgins, he ensures that no one lib
> is taking shortcuts or misrepresenting their framework.
> If you really want your Taskspeed tests considered lagit, fork his,
> add it, and send him a pull request.
> If you take issue with one or more of the tests you can correct it and
> send him a pull request.
>
> Please correct me if I am wrong on this.
> When I or others find flaws in your work it's not a knock against you
> or your framework in fact you did it, whatever the flaw is, by design.
> On the other hand when you find faults in others code/frameworks/
> libraries they are labeled incompetent.
>
> As for unit tests (massive fails):
>
> (failing Prototype tests)http://dl.dropbox.com/u/513327/mylib/test/prototype.html
>
> (failing jQuery tests, commented out the jq custom selector tests)http://dl.dropbox.com/u/513327/mylib/test/jquery1.htmlhttp://dl.dropbox.com/u/513327/mylib/test/jquery2.html(wonteven run
> the tests some bug in mylib)

My Library won't run jQuery's unit tests and you consider this to be a
bug in My Library? Pardon me if I ignore the rest of your
reports. :)

>
> (failing Dojo, Yahoo, Closure, and other tests)http://dl.dropbox.com/u/513327/mylib/test/slick.html
>
> (simple Slickspeed that works with your limited set of selectors
> showing it as one of the slowest)http://dl.dropbox.com/u/513327/mylib/slickspeed/index.html

Why would you have to reproduce that page? There's already a page on
cinsoft.net that runs the "limited" (40 - 4 or so IIRC) selectors.
Any result that shows it as one of the "slowest" is clearly suspect.
I can tell you that without looking at any of your results (I've seen
all of the code). ;)
From: David Mark on
On Jan 27, 3:20 pm, Scott Sauyet <scott.sau...(a)gmail.com> wrote:
> On Jan 27, 12:09 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
>
> > TaskSpeed is another quasi-standard test that has never seen anything
> > like My Library. :) It was written by one of the Dojo guys. Yeah, I
> > know. :(
>
> >http://www.cinsoft.net/mylib-testspeed.html
>
> > It just flat-out murders the rest (even Dojo) And yes, the test
> > functions are _very_ concise (even too concise). And no, they aren't
> > even close to optimized. They even use the (optional) OO interface.
> > So there's really nothing left to argue as My Library is somehow
> > (much) faster _and_ more concise. Not to mention compatible with
> > virtually any agent, past, present or future. ;)
>
> My results don't agree. I've posted another version, which restricts
> the comparison to the latest versions of the libraries from your list,

My list?! It's the TaskSpeed suite downloaded from Higgins' site.

> upgrading to the latest version of jQuery and MooTools. (I couldn't
> find test files for more recent versions of YUI or qooxdoo; the others
> were already at the latest, I believe.)

Great. I added YUI3 to mine. It's slower than the previous YUI (of
course).

> I ran the tests on a modern
> Windows XP SP2 machine with dual 3.0GHz CPUs and 3.25 GB of RAM.

Okay.

>
> While My Library here performs well, it's far from murdering the
> competition.

I'll be sure and run them through the gamut... And you have to look
at it as a whole (tested across a wide set of agents):-

1. Much faster
2. Compatibility with more than just the lastest browsers :)
3. Comparitively smaller
4. No dubious plug-ins to download (and download and download...)

5. Last (but hardly least), not full of browser sniffs and other
incompetent nonsense (see jQuery discussions going back for years).

>
> My tests are at:
>
> http://scott.sauyet.com/Javascript/Test/taskspeed/2010-01-27a/
>

I will definitely try them out. I assume you used the version with
the QSA add-on. :)

> My results are here:
>
> http://scott.sauyet.com/Javascript/Test/taskspeed/2010-01-27a/results/
>
> I will duplicate those results as an ASCII table below.

Thanks!

>
> Among the seven libraries tested, my results rank My Library as second
> fastest in Chrome, third in Firefox, fourth in IE, second in Opera,
> and first in Safari (here beating even the "Pure DOM" solution by over
> 30%!) These are good results, no doubt, but not a runaway win.

Well, they are just one set of results on one machine. We test lots
of machines and look at the aggregate picture, considering slower,
older and limited agents, as well as the current run-of-the-mill
Windows installation.

But, lets break the results down. Chrome is really a photo finish
between Qooxdoo and My Library (7ms difference). So call that a tie
for first. On slower machines, phones, etc. My Library kills ooxdoo
(how do you even pronounce that?) Same in newest FF (looks like a
three-way tie). On older FF's, My Library is exponentially faster
than all of them. Looking ahead, there's really not much to recommend
any of the (buggy as hell) others over My Library. They'd have to
demonstrate massive speed advantages to overcome all of the other
inherent objections. ;)


If
> any library can claim to be fastest from my tests, it's definitely
> qooxdoo, which was the fastest in four of the five browsers, and
> outperformed the "Pure Dom" tests in three of them.

You are putting way too much stock into one test run. ;)

>
> I first tried testing against a version of My Library that I
> downloaded January 22. Many of the tests failed.
> Has the API changed
> so drastically in the last few days?

Per user requests, I added some new selectors. I also added some new
syntactic sugar to the (optional) OO interface so that nobody would
cry foul about "cheating" with "pure" DOm methods. That's what you
are seeing. The core API is unmoved (most of it for years).

>
> -- Scott
>
> Results (ASCII table, useful mainly with fixed-width font)
> ==========================================================
>
> Browsers:
> ---------
> Chrome 3.0.195.27
> Firefox 3.5.7
> IE 8
> Opera 9.64
> Safari 4.0.3
>
> +--------+--------+--------+--------+--------+
> | Chrome | Firefox| IE | Opera | Safari |
> +-------------------+--------+--------+--------+--------+--------+
> | Pure Dom | 206 | 290 | 906 | 219 | 224 |
> +-------------------+--------+--------+--------+--------+--------+
> | Dojo 1.4.0 | 225 | 428 | 2018 | 309 | 202 |
> +-------------------+--------+--------+--------+--------+--------+
> | jQuery 1.4.0 | 458 | 937 | 2922 | 484 | 388 |
> +-------------------+--------+--------+--------+--------+--------+
> | MooTools 1.2.4 | 304 | 851 | 5686 | 642 | 244 |
> +-------------------+--------+--------+--------+--------+--------+
> | Prototype 1.6.0.3 | 405 | 1105 | 4529 | 920 | 353 |
> +-------------------+--------+--------+--------+--------+--------+
> | qooxdoo 0.8.2 | 160 | 406 | 1593 | 217 | 218 |
> +-------------------+--------+--------+--------+--------+--------+
> | YUI 2.7.0 | 299 | 866 | 2172 | 439 | 317 |
> +-------------------+--------+--------+--------+--------+--------+
> | My Library (QSA) | 167 | 447 | 2642 | 269 | 155 |
> +-------------------+--------+--------+--------+--------+--------+

YUI 2.7? I thought you were using the latest stuff? See mine. I
just added YUI3 (waste of time though).
From: Scott Sauyet on
On Jan 27, 12:09 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
> TaskSpeed is another quasi-standard test that has never seen anything
> like My Library.  :)

I think one of your tests is incomplete.

The test indexOf is documented like this:

"indexof" : function(){
// in a 20-iteration for loop:
// find the node with id="setid150"
// find all the ul's in the DOM
// locate the index of the found node in the list of nodes
// return that index
}

but your implementation (as of a few minutes ago, at least, skips the
20-iteration loop:

"indexof" : function(){
var target = API.getEBI('setid150'), index = 0;
Q('ul').forEach(function() { index = this.indexOf(target); });
return index;
},

I can't imagine it make too much of a difference in the overall
results, but it's probably worth fixing sooner rather than later.

-- Scott

From: David Mark on
On Jan 27, 4:02 pm, Scott Sauyet <scott.sau...(a)gmail.com> wrote:
> On Jan 27, 12:09 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
>
> > TaskSpeed is another quasi-standard test that has never seen anything
> > like My Library.  :)
>
> I think one of your tests is incomplete.
>
> The test indexOf is documented like this:
>
>     "indexof" : function(){
>         // in a 20-iteration for loop:
>         //     find the node with id="setid150"
>         //     find all the ul's in the DOM
>         //     locate the index of the found node in the list of nodes
>         // return that index
>     }
>
> but your implementation (as of a few minutes ago, at least, skips the
> 20-iteration loop:
>
>     "indexof" : function(){
>         var target = API.getEBI('setid150'), index = 0;
>         Q('ul').forEach(function() { index = this.indexOf(target); });
>         return index;
>     },

Ah, I may have screwed that up. It's been a whirl-wind last 24 hours
or so. I had no idea how much faith (and spin) people put into these
silly tests. :)

Thanks for noticing that.

>
> I can't imagine it make too much of a difference in the overall
> results, but it's probably worth fixing sooner rather than later.

No question. If it is wrong, it must be fixed. Will do shortly...

JFTR, these are the tests as of thirty seconds ago:-

"make" : function(){
var myEl = E(), body = API.getBodyElement();
for (var i = 0; i < 250; i++) {
myEl.loadNew('ul', {'class':'fromcode', id:'setid' + i}).setHtml
('<li>one</li><li>two</li><li>three</li>').appendTo(body);
}
return $('ul.fromcode').length;
},

"indexof" : function(){
var target = API.getEBI('setid150'), index = 0;
Q('ul').forEach(function() { index = this.indexOf(target); });
return index;
},

"bind" : function(){
return Q('ul > li').on('click', function(){}).length();
},

"attr" : function(){
return Q('ul').map(function(el) { return el.id; }).length;
},

"bindattr" : function(){
var subscriber = function() {};
return Q('ul > li').on('mouseover', subscriber).setAttribute('rel',
'touched').off('mouseover', subscriber).length();
},

"table": function(){
var myTable = E(), myCell = E(), body = API.getBodyElement();
for (var i = 0; i < 40; i++) {
myTable.loadHtml('<table class="madetable"><tbody><tr><td>first</
td></tr></tbody></table>').appendTo(body);
myCell.loadNew('td').insertBefore(myTable.descendants('td')[0]);
}
return $('tr td').length;
},

"addanchor" : function(){
var myEl = E();
return Q('.fromcode > li').forEach(function(li){
myEl.loadNew('a', { href:"http://example.com" }).appendTo(li);
}).length();
},

"append" : function(){
var myEl = E(), body = document.body;
for (var i = 500; i--;) {
myEl.loadNew('div', { 'rel':'foo2' }).appendTo(body);
}
return $("div[rel^=foo2]").length;
},

"addclass-odd" : function(){
return Q('div').addClass('added').filter(function(el, i) {
return (i % 2);
}).addClass('odd').length();
},

"style": function(){
return Q('.added').setStyles({
backgroundColor:'#ededed',
color: '#fff'
}).length();
},

"removeclass": function(){
return Q('.added').removeClass('added').length();
},

"sethtml": function(){
var myEl = E();
return Q('div').setText('').forEach(function(el) {
myEl.loadNew('p').setText('New content').appendTo(el);
}).load('div').length();
},

"insertbefore" : function(){
var myEl = E();
return Q('.fromcode a').forEach(function(a) {
myEl.loadNew('p').setText('A Link').insertBefore(a);
}).length();
},

"insertafter" : function(){
var myEl = E();
return Q('.fromcode a').forEach(function(a) {
myEl.loadNew('p').setText('A Link').insertAfter(a);
}).length();
},

"destroy": function(){
return Q('.fromcode').remove().length();
},

"finale": function(){
return E(API.getBodyElement()).empty().descendants().length;
}

They are slowing down a bit as I condense the last few bits, but still
nowhere near a horse race in anything I've tested so far. Nothing has
changed radically from the results I posted to the forum yesterday.

Write once, do nothing, run anywhere, forever! Contrast with: write
forever, run for a while maybe, do get fired. jQuery junkies should
take particular note. This is your methadone. ;)