Skip to content

ALL-PERF1004 · algorithmic_complexity

Judge whether algorithmic growth fits plausible workload bounds.

This is a contextual rule for all languages. Read its implementation.

Compare time and space growth, input bounds, constants, allocation, data distribution, maintained library alternatives, measured workloads, and performance objectives. A single nonrecursive loop is structurally linear and does not need contextual judgment.

Findings cite loops or algorithms, bounds, workloads, profiles, alternatives, and objectives.

Small verified inputs may justify a simpler algorithm with a worse asymptotic bound.

A quadratic comparison over unbounded user records is risky. A quadratic scan over at most eight items is a tradeoff, since the bound is what makes the cost affordable. A linear pass sized to its input is proportionate, and a quadratic step a linear one would replace outright is avoidable.

  • Cites “Beyond the Basic Stuff with Python”, Measuring Performance and Big O
  • Cites “The Algorithm Design Manual”
  • Cites “The Pragmatic Programmer”, estimate the order of algorithms