Identify the complexity class implied by measured runtimes at two input sizes.
Taking the log ratio of runtimes over the log ratio of sizes recovers the exponent empirically. An exponent near one indicates linear behaviour and near two indicates quadratic. Measuring the exponent from real timings catches accidental quadratic behaviour that code review often misses, such as a lookup inside a loop.
Big O
Exponent = log(runtime ratio) ÷ log(size ratio)
Exponent = log(runtime ratio) ÷ log(size ratio) Taking the log ratio of runtimes over the log ratio of sizes recovers the exponent empirically. An exponent near one indicates linear behaviour and near two indicates quadratic.
Measuring the exponent from real timings catches accidental quadratic behaviour that code review often misses, such as a lookup inside a loop.
This calculator takes 4 inputs: First input size, Runtime at the first size, Second input size, Runtime at the second size. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.