Big-O Complexity Benchmarker
Profile code execution steps and benchmark performance curves in real-time. Compare sorting and search scripts visually.
Construct benchmarking algorithms, profile runtime execution steps, and draw custom line charts using the Canvas API.
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.
Topology Flow
The benchmark runner operates as a localized performance loop:
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.
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
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.
Built With
Source & Deploy
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.
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.