Airysh

Airysh

Engineer

Read Resume

Building Perf-Wizard: An Enterprise-Grade Performance Analysis Tool

How I built an open-source JavaScript performance analyzer with AST parsing, budget validation, and CI/CD integration.

The Problem

Every JavaScript project eventually faces performance issues. Bundle sizes grow, complexity increases, and suddenly your app takes 5 seconds to load. I wanted a tool that could:

The Solution: Perf-Wizard

Perf-Wizard is an enterprise-grade performance analysis tool I built and open-sourced. It combines static analysis with practical optimizations.

Key Features

1. AST Analysis with Babel

Instead of guessing about performance issues, Perf-Wizard parses your code into an Abstract Syntax Tree:

const { BudgetValidator } = require('perf-wizard');

const validator = new BudgetValidator({
  score: { min: 80, failCi: true }
});

2. Framework-Specific Rules

Different frameworks need different optimizations:

3. Budget Validation for CI/CD

Set thresholds and fail builds when code quality drops:

# GitHub Actions
- run: npx perf-wizard --ci --score-threshold 80

4. Performance Grading

Every file gets a grade from A+ to F:

| Grade | Score | Meaning | |-------|-------|---------| | A+ | 90-100 | Excellent | | A | 80-89 | Good | | B | 70-79 | Fair | | C | 60-69 | Needs work | | F | 0-49 | Critical |

Technical Challenges

Challenge 1: Parsing TypeScript

TypeScript files need special handling. I used Babel with the TypeScript preset:

const parser = require('@babel/parser');
const ast = parser.parse(code, {
  sourceType: 'module',
  plugins: ['typescript', 'jsx']
});

Challenge 2: Caching for Speed

Re-analyzing unchanged files is wasteful. I implemented a hash-based caching system:

Challenge 3: Watch Mode

Developers want real-time feedback. The watch mode required:

What I Learned

  1. AST manipulation is powerful — Once you understand the tree structure, you can detect almost any pattern
  2. Developer experience matters — A tool nobody uses is worthless. HTML reports and clear messaging make a difference
  3. CI integration is essential — If it doesn't break the build, it gets ignored

The Numbers


Try it yourself: npm install -g perf-wizard

Repository: github.com/Airyshtoteles/perf-wizard

2026 — Airysh