July 2017
Intermediate to advanced
656 pages
16h 1m
English
In the main recipe we learned where our logic was spending a lot of time, and solved the problem by removing the overhead of one approach by replacing code with a lower impact alternative (the for loop).
Let's see if we can make the function faster.
We'll start by creating a new folder called function-inlining, then copy our no-collections.js and bench.js files into it:
$ mkdir function-inlining$ cp no-collection.js function-inlining$ cp bench.js function-inlining/initial-bench.js
As we copied our bench.js file into function-inlining we also renamed it to initial-bench since we're starting a new optimization cycle.
We need to modify function-inlining/initial-bench.js by removing the slow benchmarks, leaving only our latest ...