Back to Projects
In ProgressLLM Project

Big-O Complexity Benchmarker

Profile code execution steps and benchmark performance curves in real-time. Compare sorting and search scripts visually.

Target Learning Outcome

Construct benchmarking algorithms, profile runtime execution steps, and draw custom line charts using the Canvas API.

01. Problem it solves

Theoretical Math vs. Real Runtime

Asymptotic complexity is typically taught via pure formulas without physical performance references. Learners find it hard to understand why O(N log N) sorting is exponentially better than O(N^2) loops at scale, or how fast O(2^N) recursive steps starve CPU resources.

This project makes complexity visible by profiling execution times and graphing results dynamically, bridging theory and runtime.

02. System Architecture

Topology Flow

The benchmark runner operates as a localized performance loop:

User Script Input
JS Runtime Microsecond Profiler
Canvas Curve Generator
03. Data Flow

Execution Pipeline

1. User loads preset scripts or custom loops.
2. Execution loop runs with varying input sizes N = [10, 50, 100, 500].
3. High-resolution time-stamps capture start and end execution offsets.
4. Data coordinates are compiled and plotted onto the Canvas line grid.

04. Algorithms Used

Complexity Evaluators

The benchmark compares standard search and sort algorithms:

  • JavaScript/TypeScript execution step profiling
  • Microsecond-level performance benchmarking API bounds
  • Dynamic chart drawing via HTML5 Canvas coordinates
  • Time-space scaling tradeoff analysis
  • Asymptotic curves comparisons
05. Complexity Analysis

Execution Tradeoffs

* **Time Complexity**: Profiler calculations run in O(1) time-step recording. Graphing runs in O(N) plotting time.
* **Space Complexity**: O(N) storage to maintain performance data arrays before rendering.

06. Tech Stack

Built With

TypeScriptReactTailwind CSSCanvas APIGitHub
07. Links

Source & Deploy

GitHub Repository:big-o-benchmarker
Live Lab Endpoint:/labs/big-o-visualizer
08. Interview Explanation

Defending the Design

Interview Defense Strategy

I architected the Big-O Complexity Benchmarker to translate abstract computational complexities into tangible microsecond steps. By running multiple algorithms side-by-side on the client, users get immediate visual evidence of why linearithmic searches outperform nested quadratic loops under scale.
09. Future Improvements

Roadmap Extensions

  • Add support for space complexity heap profile tests.
  • Add multi-thread execution comparisons using Web Workers.
  • Integrate automated complexity formula estimations from AST.