Arguments Speed Boost
When I look at code like the memoizer, I find things that others gloss over because of my training. My most recent project involves a huge application with brutal SLA’s. We must look at every function call or loop critically in order to achieve the required speed. That often means A/B testing in multiple browsers to see where we can shave a few milliseconds.
Here’s another example of what I’m talking about. How often do you see developers manipulate arguments in a function the way the memoizer did?
It’s pretty standard. Well, it may seem trivial, but nothing’s free. If you don’t have to do it, don’t–that’s the easiest way to boost performance. I wrote two example tests for the most common uses of arguments: iterating and prepending.
get the Gist