HNHacker News
TopNewBestAskShowJobs

MadRabbit

184 karma · joined June 18, 2009

submissionscomments
MadRabbit··on Magic clear:both trick in pure CSS
my condolences to the poor bastards
MadRabbit··on Magic clear:both trick in pure CSS
it works in IE8, everything below it should die in pain

actually, IE8 should die in pain as well :)

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
I know about the problem.

RightJS is extra careful with native classes extensions, it adds only standard methods and doesn't extend the Object.prototype at all. In many cases it's just adds missing methods in old browsers and that's it. And we always keep the original functionality intact.

We're trying to balance between the Prototype extensions hell and jQuery agnosticism. Things like String#endsWith, Array#compact is kinda standard features, they are extremely handy in everyday work and most of soberminded programmers won't hack those methods if they create some plugin that other people might use.

As the matter of fact most of jQuery plugins don't extend prototype too.

So it is a problem, but I believe it's negotiable and there might be a non-polar solution.

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
You're saying right things about jQuery, but you seem like don't know a thing about RightJS, because it has its own nice features and most people who actually tried it for real, said that it is more comfortable and fun to work with than jQuery.

As for the safe mode, first of all it's not such a big problem as people usually think and actually provides more help than issues, and secondly RightJS will end up with a safe mode plugin sooner or later.

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
I've updated the screenshots, adding those two new tests. It actually increased the overall gap between RightJS and jQuery 8)
MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
Okay I've added it to the test.

Insert element bottom 48 131 169

Insert element on top 48 134 167

Don't know about the release notes, my test says 1.4 is slower than 1.3.2

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
At the beginning you're kinda was against the "make" test, because there is no such thing in jQuery, and now you practically offer the same thing, to test something that does exist in jQuery but doesn't in RighJS.

You should choose already what do you stand for.

But anyway, if you want to test it go ahead, you know where the code is. I suppose jQuery handles virtual selectors via JavaScript and therefore there will be no serious difference in performance. I even suspect that a single additional function in the filter method in RightJS will still work faster than several internal selectors in jQuery.

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
> Live binds one event handler to a parent element and then simply watches for any events

It's kinda different story and rather a hack than a standard approach. And it's not always a cace, because it will handle the callbacks slower than a direct bind and therefore not always appropriate.

In any case it's not what the test is intended to do. We test standard operations, that's all. Testing live with bind is like comparing apples with oranges.

> How about '.Class .child:visible:not(.test):eq(1)'?

Do you mean non-standard css-selectors? There is nothing to test, rightjs simply doesn't support them

With rightjs you always can do it like that

$$('.class').filter('visible');

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
Igor, as I said below, testing elements building is only one test and you can ignore it if disagree.

> Instead let's test selector speeds etc.

Actually this is what's pointless, both of the frameworks do it by using native features of the modern browsers and results will about the same for any framework.

> i would use jQuery's live() and then binding takes almost no time for any number of elements.

Are you sure about that?

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
the benchmark is just a proof o point, nothing else. and certainly I know why jQuery is popular.

But as for the second part, I don't see any difference in coding efforts between jQuery and RightJS, if you really read the tests on github, you will see the size of code is about the same, RightJS is even compacter in many places.

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
no problem
MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
It is arguable. For this reason I left the thing in one single test.

So that you have a choice. If you disagree, then you don't count this line, if you do agree then you count it.

Either way RightJS comes faster

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
It's not slower, PureDom is faster in most of the tests, there are just couple of tests insert/before/after that seems have slower implementation, don't really now why.

It's not RightJS only, Dojo and YUI win in those tests too.

Generally speaking PureDom is still faster than RightJS. It has to be.

MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
fixed. thanks for heads up!
MadRabbit··on RightJS vs jQuery Mano A Mano (clean test comparison)
Probably, but don't blame me, I just test how jQuery actually builds elements, because people do build elements this way from time to time.

But don't count it if you don't like the idea, it's just one test among many others and not the slowest one. So it won't change a lot.

← PreviousPage 2 of 2