[jQuery] jQuery speed-up hack

[jQuery] jQuery speed-up hack

(Warning: my hack is not very compatibile with existing jQuery codebase)
An application I've used jQuery with became dog-slow after a while. The
problem was I've used $(".ClassName") a lot to link functions (like
show/hide panel on checkbox click) to page elements. Perhaps it was a
change in jQuery, perhaps I've made some mistake in my code, didn't matter
-- the app was too slow for production (4-5s on each pageload).
I've narrowed the problem to the $() function, which currently is huge and
contains most of the functionality. I've cut out the "self = { ... }" and
moved it into:
var $$$$ = function(){};
$$$$.prototype = {
    $jquery: "$Rev: 646 $",
    // The only two getters
    size: function() {return this.get().length;},
    // ...and all the other code
}
So now my $() function looks like this:
function $(a,c) {
    var $a = a || $.context || document;
    var $c = c && c.$jquery && c.get(0) || c;
    var out = new $$$$;
    out.cur = $.Select($a,$c);
    return out;
}
I've cut out the Prototype compatibility code, I didn't have use for it.
I've also changed all the $.fn declarations to $$$$.prototype declarations.
This cut the load time from over 5000ms to to 70ms.
--
MichaƂ Tatarynowicz
Sputnik!
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/