Getting ready

Having understood the portion of our code that needs work, our next step is to isolate the problem area and put together a micro-benchmark around it.

We'll be using https://github.com/bestiejs/benchmark.js to create micro-benchmarks for single functions.

Let's create a new folder called sync-opt, initialize a package.json file, and install the benchmark module as a development dependency:

$ mkdir sync-opt
$ npm init -y
$ npm install --save-dev benchmark