From: Andrea Giammarchi on
Scott fine, RobG idem, I'll talk with @phiggins as soon as I'll have
time.
To me could make sense to write a PureCheat library to put beside
PureDOM, not a replacement, since in any case, innerHTML could be a
problem.

As example, the first test via innerHTML will potentially destroy
every attached event handler to existent content.
I have that fast version, I hope to have time to create a full
PureCheat version as well.

Regards

P.S. same webreflection that blogs sometimes in Ajaxian, that is kinda
still me ;-)
From: David Mark on
On Jan 27, 9:02 pm, Andrew Poulos <ap_p...(a)hotmail.com> wrote:
> On 28/01/2010 11:53 AM, RobG wrote:
>
>
>
>
>
> > On Jan 28, 3:09 am, 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)
>
> > Not on my machine - Windows XP, 3.3GHz P4. Here's the results for
> > Firefox 3.5 and IE 6:
>
> > Library             Fx      IE 6
> > PureDom*            794    3,031
> > jQuery 1.2.6      5,830   36,326
> > jQuery 1.3.2      3,763   11,826
> > Prototype 1.6.0.3 2,879   37,185
> > MooTools 1.2.2    2,306   20,358
> > qooxdoo 0.8.2     1,051    4,062
> > Dojo 1.3.2        1,218    9,110
> > Dojo 1.4.0        1,198    5,125
> > YUI 2.7.0         2,300    7,063
> > YUI 3.0           1,062    3,954
> > My Library 1.0    1,371    5,625
>
> My testing on MS Vista:
>
> Library          Fx 3.6     IE 8  Op 10.10  Safari 4.04
>
> PureDom             282    1,211       190          246
> jQuery 1.2.6      1,692    6,269     1,904        1,188
> jQuery 1.3.2      1,401    3,219       956          708
> Prototype 1.6.0.3   889    3,790       830          385
> MooTools 1.2.2      733    5,711       451          276
> qooxdoo 0.8.2       405    1,383       180          208
> Dojo 1.3.2          435    2,104       217          271
> Dojo 1.4.0          448    1,771       266          245
> YUI 2.7.0           788    2,370       517          286
> YUI 3.0             440    1,531       252          255
> My Library 1.0      448    1,757       222          168
>
> I'm not sure how myLib can be faster than pure dom???
>

"Pure DOM" was written by a human being, just like the rest.
Obviously they made some mistakes as it is nowhere near optimal
(particularly in Webkit-based browsers).

And realize that the tests for each framework are different. I
purposely optimized for conciseness, not speed. Most of the others
are using built-in DOM methods for at least some of the test
functions. My point is that I have the best of both worlds. If you
want pure speed, use the more verbose API. If you like jQuery-like
gibberish, chain the object methods together like I did in the test
functions. It's flexible that way. ;)
From: David Mark on
On Jan 27, 7:53 pm, RobG <rg...(a)iinet.net.au> wrote:
> On Jan 28, 3:09 am, 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)
>
> Not on my machine - Windows XP, 3.3GHz P4. Here's the results for
> Firefox 3.5 and IE 6:
>
> Library             Fx      IE 6
> PureDom*            794    3,031
> jQuery 1.2.6      5,830   36,326
> jQuery 1.3.2      3,763   11,826
> Prototype 1.6.0.3 2,879   37,185
> MooTools 1.2.2    2,306   20,358
> qooxdoo 0.8.2     1,051    4,062
> Dojo 1.3.2        1,218    9,110
> Dojo 1.4.0        1,198    5,125
> YUI 2.7.0         2,300    7,063
> YUI 3.0           1,062    3,954
> My Library 1.0    1,371    5,625


>
> In Firefox My Library is beaten by YUI 3.0 and Dojo versions 1.4 and
> 1.3.2.

Which My Library? The one with QSA or not? It makes a small
difference in TaskSpeed (and a huge one in SlickSpeed).

> In IE 6, it is beaten by YUI 3.0, Dojo 1.4 and qooxdoo.
> Prototype failed the insertAfter test in both Firefox and IE 6,

None of the others comes close to supporting IE6 properly (e.g. they
just call getAttribute without regard to the broken implementation).
Of course, that's more of a concern for SlickSpeed.

>
> > And yes, the test
> > functions are _very_ concise (even too concise).
>
> If "concise" means less code, then the library itself is 145KB, which
> is twice the size of YUI 3,

That's with _every_ module included (e.g. Flash, audio, scrolling
effects, etc). Most of them are not needed by these tests.

> though smaller than the monstorous
> qooxdoo. Perhaps the size can be optimised so that each libarary only
> contains the components required for the particular tests.

That's what the builder is for. ;)

>
> The test code itself is not as concise as that for jQuery, and not
> much more concise than most of the others.

I looked at some of them and more than one was using native DOM
methods, so it seems they are apples and oranges. I remember that
YUI's weren't particularly concise.

> Prototype and MooTools are
> perhaps the least concise, the total code for the "pure DOM" is 10KB.

Sure. It's just enough to run these tests. ;)

>
> But the test code is tiny in comparison to the library itself, so not
> really a huge concern.

My point is that it supports the "concise" coding style that is so
popular among major library enthusiasts (and is very fast doing it).
It also supports more traditional methods (even faster).

And I have found after extensive testing that the margin of victory is
wider on older machines, older browsers, phones and Webkit-based
browsers. Faster PC's running IE and FF have closer results.

And ultimately, if a library that is supposed to make cross-browser
scripting easier fails to handle attributes properly in IE or resorts
to non-solutions like browser sniffing, it should be disallowed (which
rules out all of the others). I plan to demonstrate that on the test
pages in the near future. It should come as no great revelation to
regular readers of this group though. ;)
From: David Mark on
On Feb 4, 11:55 am, Andrea Giammarchi <andrea.giammar...(a)gmail.com>
wrote:
> And Finally:http://debuggable.com/posts/rightjs-1-5-6-8-times-faster-than-jquery:...
>
> With explanation about PureDOM, a proper cheat via innerHTML (did not
> spend too much to create it tho) and the reason this thread is
> pointless, imho.

I'd say your contributions have been pointless so far. Yes, you
should make the "baseline" as fast as possible without sacrificing
cross-browser compatibility.
From: David Mark on
On Feb 4, 12:44 pm, Scott Sauyet <scott.sau...(a)gmail.com> wrote:
> On Feb 4, 11:45 am, Andrea Giammarchi <andrea.giammar...(a)gmail.com>
> wrote:
>
> > and whcih library outperform PureDOM?
>
> I posted my results earlier in the thread:
>
>    http://scott.sauyet.com/Javascript/Test/taskspeed/2010-01-27a/results/
>
> Dojo outperformed it in Safari, qooxdoo did in Chrome, Opera, and
> Safari, and My Library did in Chrome and Safari.  None of the speed
> differences were huge.

They are on older PC's (and mobile devices). 60% faster in Chrome/
Safari on an older (but not ancient) XP box. Lots of "normal people"
have such equipment, of course.