Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Next.js Performance AnalyzerNew to Visual Studio Code? Get it now.
Next.js Performance Analyzer

Next.js Performance Analyzer

HimaD

|
1 install
| (0) | Free
Detect and validate frontend performance anti-patterns in Next.js App Router projects with automated Lighthouse benchmarking.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Next.js Performance Analyzer

A production-quality VS Code extension for detecting and validating frontend performance anti-patterns in Next.js App Router projects.


Features

  • Static AST scanning of your Next.js project source files
  • Rule-based issue detection with a plugin architecture
  • VS Code inline diagnostics (underlines, tooltips)
  • Persistent issue tracking — issues survive editor restarts
  • Fix tracking — automatically marks issues as FIXED on rescan
  • Route mapping — every issue is linked to its Next.js route
  • Automated Lighthouse benchmarking — 10 runs per route with fixed throttling
  • Median metrics — LCP, INP, CLS, TBT, Performance Score
  • Environment logging — CPU, RAM, OS, Node, Chrome, Lighthouse versions
  • Professional adaptive dashboard — works with all VS Code themes

Commands

Command Description
Next.js Analyzer: Analyze Project Scan the workspace and detect issues
Next.js Analyzer: Open Dashboard Open the performance dashboard
Next.js Analyzer: Run Benchmark Run Lighthouse benchmark for a route
Next.js Analyzer: Clear All Issues Remove all stored issues

Setup

Prerequisites

npm install -g lighthouse

Chrome must be installed for Lighthouse.

Install Extension Dependencies

cd nextjs-performance-analyzer
npm install

Running in Development

  1. Open this folder in VS Code
  2. Press F5 to launch Extension Development Host
  3. Open a Next.js project in the new window
  4. Run Next.js Analyzer: Analyze Project from the Command Palette

Configuration

Setting Default Description
nextjsAnalyzer.serverPort 3000 Port the Next.js server runs on
nextjsAnalyzer.benchmarkRuns 10 Number of Lighthouse runs per benchmark
nextjsAnalyzer.autoAnalyzeOnSave false Re-analyze on every file save
nextjsAnalyzer.cpuSlowdownMultiplier 4 CPU throttle multiplier for Lighthouse

Architecture

Workspace Project
      ↓
Project Scanner          (src/scanner/projectScanner.js)
      ↓
AST Parser               (src/parser/astParser.js)
      ↓
Rule Engine              (src/rules/index.js)
      ↓
Issue Detection Engine   (src/engine/issueEngine.js)
      ↓
Issue Persistence Manager (src/engine/issuePersistence.js)
      ↓
Fix Tracking Engine      (src/engine/fixTracker.js)
      ↓
Benchmark Orchestrator   (src/engine/benchmarkOrchestrator.js)
      ↓
Environment Monitor      (src/engine/environmentMonitor.js)
      ↓
Diagnostics Manager      (src/engine/diagnosticsManager.js)
      ↓
Dashboard UI             (src/dashboard/)

Storage

Issues and benchmark results are stored locally in:

{project-root}/.nextjs-analyzer/
  issues.json
  benchmarks.json

Add .nextjs-analyzer/ to .gitignore if you don't want to commit these files.


Adding New Rules

  1. Create a new file in src/rules/ ending with Rule.js
  2. Export the required interface:
module.exports = {
  id: 'MY_RULE_ID',
  name: 'Human readable name',
  description: 'What this rule detects.',
  severity: 'HIGH', // HIGH | MEDIUM | LOW
  applies(filePath) {
    return /\.(js|jsx)$/.test(filePath);
  },
  detect(ast, filePath, route) {
    // traverse ast, return array of raw issue objects
    return [];
  },
};

The rule is automatically loaded by src/rules/index.js — no registration needed.


Implemented Rules

Rule ID Description Severity
UNNECESSARY_USE_CLIENT "use client" with no client-side APIs/hooks/event handlers HIGH

Benchmark Throttling Settings

Parameter Value
CPU Slowdown 4×
Download Throughput ~1440 Kbps
Upload Throughput ~660 Kbps
Latency 150 ms
Method simulate

These match Lighthouse's default "Slow 4G" mobile simulation preset.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft