On 12/20/05, Ryan Gahl <[EMAIL PROTECTED]> wrote: > Wow, that is some major difference! I know nothing about Sam's plans or > how to get any of this into the official branch, but before I copy your > version into my project, would you mind explaining briefly the things > you changed? > Thank you. > > -Ryan Gahl >
------8<------------------------ %> diff prototype.js prototype1.4-opt.js 401c401,402 < for (var i = 0; i < iterable.length; i++) --- > var len = iterable.length; > for (var i = 0; i < len; i++) 413c414,415 < for (var i = 0; i < this.length; i++) --- > var len = this.length; > for (var i = 0; i < len; i++) 451c453,454 < for (var i = 0; i < this.length; i++) --- > var len = this.length; > for (var i = 0; i < len; i++) 837c840,841 < if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) --- > var re = new RegExp("(^|\\s)" + className + "(\\s|$)"); > if (child.className.match(re)) ------8<------------------------ That's all ! It's amazing to see that how 3 little optimizations can improve performance! Krzysztof, I hope that your patch will be integrated soon because it is really usefull... 8) Thanks, Nicolas Terray _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs