Practice Timing Benchmarks

In this three-phase exercise, you will be implementing a few simple JavaScript functions, then testing them at massive scale.

Goals

  • Practice for-loop fundamentals
  • Get comfortable with large n values
  • Practice timing code with Date.now() and console.time()
  • Record and display timing results on a Google Sheet
  • Identify and prove that code is O(1), O(n) or O(n^2)

Setup

  1. Clone the starter repo at starter
  2. Install all packages with npm install

Phases

  1. Implementation - Implement the code you will be testing in the other phases
  2. Scale testing harness - Testing your code for a variety of inputs
  3. Timing your code - Measure the time it takes to run with various input sizes