Wednesday, June 28th, 2006>p>Sylvain Zimmer has written a performance upgrade for Prototype’s $$ function that he claims is up to twenty times faster.
Sylvain’s ideas behind the patch are as follows:
- Forwarding the call to the old $$ if the selector expression is too complicated (currently : if it uses attributes)
- Replacing regular expressions with a simple parser
- Minimizing the number of operations done on each iteration.
- Trying to use getDocumentById() instead of getDocumentByTagName() when possible.
- Avoiding recursive functions with return values.
- Not being afraid of some “old-style” code if it speeds up the execution ;-)
Now, lets see if Sam applies it…
Posted by Rob Sanheim at 9:35 am