On Wed, Oct 15, 2008 at 1:01 PM, Arnar Birgisson <[EMAIL PROTECTED]> wrote:
> Done. Yup, the number of nodes is not correct (or at least as correct
> as th other frameworks). Performance takes a minor hit, mainly because
> it is so bad to begin with :)
Ah, you mean "now correct"... :-)
Disturbing that this fix actually affects performance in a noticable
way. It really shouldn't, except when more than ~100 elements are
matched. Perhaps there are some obvious improvements to be made in my
uniq() implementation:
var uniq = function(arr) {
var res = [];
for (var i = 0; i < arr.length; i++) {
if (MochiKit.Base.findIdentical(res, arr[i]) < 0) {
res.push(arr[i]);
}
}
return res;
};
I think the above should be O(n^2). Not optimal, but fixing the root
cause means rewriting the module altogether. :-(
> Me too. The current implementation is quite bad and it is my fault for
> not updating it since the early Prototype port. Sizzle is quite
> simple, there are no specific "tricks" to make it fast, but the design
> is nice.
Yes, it is much clearer. I have a few opinions about it of course, but
I think I'll fork the Sizzle project on github to fix those when/if I
have time.
Many thanks for your help, Arnar!
Cheers,
/Per
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---