Syntic
← All skills
EngineeringFreeCommunityv1.0.0

performance-profiler

Use when investigating slow endpoints, planning performance budgets, or hunting memory leaks in production applications.

About this skill

Use when investigating slow endpoints, planning performance budgets, or hunting memory leaks in production applications.

SKILL.md

performance-profiler.SKILL.md

Place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review the contents and run it in a controlled environment first.

SKILL.md
---
name: performance-profiler
description: Use when investigating slow endpoints, planning performance budgets, or hunting memory leaks in production applications.
category: Engineering
version: 1.0.0
tools: []
---

# Performance Profiler

**Tier:** POWERFUL  
**Domain:** Performance Engineering

Systematic performance profiling for Node.js, Python, and Go applications. Identifies CPU, memory, and I/O bottlenecks; generates flamegraphs; analyzes bundle sizes; optimizes database queries; detects memory leaks; and runs load tests.

## Core Capabilities

- **CPU profiling** — flamegraphs for Node.js, py-spy for Python, pprof for Go
- **Memory profiling** — heap snapshots, leak detection, GC pressure
- **Bundle analysis** — webpack-bundle-analyzer, Next.js bundle analyzer
- **Database optimization** — EXPLAIN ANALYZE, slow query log, N+1 detection
- **Load testing** — k6 scripts, Artillery scenarios, ramp-up patterns
- **Before/after measurement** — establish baseline, profile, optimize, verify

## When to Use

- App is slow; bottleneck is unknown
- P99 latency exceeds SLA before release
- Memory usage grows over time (suspected leak)
- Bundle size increased after adding dependencies
- Preparing for traffic spike (load test before launch)
- Database queries taking >100ms

## Golden Rule: Measure First

Establish baseline BEFORE optimization:
- Record P50, P95, P99 latency
- Record RPS, error rate, memory usage
- Profile → confirm bottleneck → fix → measure again → verify improvement

## Node.js Profiling Workflow

Use Node.js Inspector for CPU and heap snapshots:
- CPU: `node --prof`, then `node --prof-process` for flamegraph
- Memory: heap snapshots via DevTools
- Streaming: use clinic.js or 0x for real-time flamegraphs

## Database Optimization

- Run `EXPLAIN ANALYZE` on slow queries
- Add indexes on frequently filtered columns
- Detect N+1 queries via query logging
- Use connection pooling

## Load Testing

- k6 for scripted load tests with realistic user flows
- Artillery for simpler, declarative scenarios
- Ramp up gradually; measure P50/P95/P99 latency under load
- Target: maintain SLA under peak traffic

## Bundle Analysis

- webpack-bundle-analyzer for JS/CSS sizes
- Next.js built-in analyzer for app router
- Identify unused dependencies
- Set bundle size budgets in CI

Install

Syntic App

  1. 1Create a dedicated folder for this skill in your local skills library.
  2. 2Place SKILL.md into that folder.
  3. 3Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1Save SKILL.md in your local Syntic Code skills directory.
  2. 2Keep related files in the same skill folder.
  3. 3Run in a safe environment and validate outputs.