Marvelous Optimization #4 - Optimized Again
Last September I wrote an article about a custom function that I optimized to evaluate hundreds times faster. At the end of the article, I challenged my readers and myself by claiming that the already optimized custom function can be optimized even further. Do you remember?
Later on I actually really optimized it again, and talked about this optimization during my session at Pause On Error [x] London 2011. Now you can watch the video of this part of my session below:
This example proves that my Marvelous Optimization Formula really works.
Let me repeat the formula here:
- The more marvelous it appears the less you believe it is the right way.
- The less you believe it is the right way the more probably you’re going to do it the stupid way.
- The more stupid way you do it the more marvelous the right way appears.
Following the formula, I have found out that doing 250 substitutions on a string that contains maybe 10 different HTML entities is exactly that stupid thing that makes the function optimizable.
Try it out yourself. Just click the button below to download an updated version of my sample file, and feel free to examine it.
Do you like it? OK, now it's your turn to do some marvelous optimizations.
Just grab the tools, use them, and share your results in the Comments section below.