On Tue, 31 Jan 2012 08:36:02 -0800, Tei <oscar.vives(a)gmail.com> wrote:
*Cough* some random article about making js that is
not abusing the
slower parts of the language
Bah, that frankly looks worthless.
It goes all over extremely micro optimizations. The kind of thing that'll
have almost no effect and even less effect as JS engines get better. And
sticking obsessively to that kind of coding inevitably ends up to horridly
hard to read and manage code. We should be advocating good readable coding
style over micro-optimizations for performance.
Some of the examples even look broken.
And the way he uses $("<div/>") in a loop. You'd think that someone
obsessed with performance would forgo re-running jQuery's "Is this some
html or a query" checks and dom creation and just use .clone().
And to top it off, it doesn't even bother pointing out .delegate over
.live. Something that could actually have an effect in improving page
performance. I hate .live, it binds the event to the body instead of
binding it only as far out as it needs to go, and even does it after doing
a worthless dom query. And as a result things bound with .live end up
having piles of worthless dom events executed just to be exited by jQuery.
THAT does affect performance when you have hundreds of dom events that
don't need to fire.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name