perf-optimization

Convert profiling data into prioritized, benchmark-verified code optimizations.

1|Updated Jul 12, 2025
One-click install
npx skills add https://github.com/ubay1/next15-starter --skill perf-optimization-ubay1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perf-optimization
Source: https://github.com/ubay1/next15-starter/tree/main/.agents/skills/perf-optimization
Command: npx skills add https://github.com/ubay1/next15-starter --skill perf-optimization-ubay1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Performance issues are often hard to diagnose and easy to accidentally worsen without clear evidence, so this Skill provides a profile-driven method to identify bottlenecks and apply safe optimizations that you can verify with benchmarks.

Core Features & Use Cases

  • Profile-first workflow: guides you through collecting and reading CPU/heap/trace data, focusing on signals like cumulative cost and distinguishing user-land cause from runtime noise.
  • Prioritized optimization plan: ranks fixes by impact/risk and enforces a “do first / do second / do last / skip” decision rule to prevent low-value tuning.
  • One-change-at-a-time safety: requires tests first, immediate benchmark after each change, and clear stopping heuristics (e.g., <5% gain within noise).
  • Pattern catalog for common bottlenecks: includes practical, reusable patterns like caching, pre-allocation, fast-reject, pooling, batching, vendor chunk partitioning, and concurrent-fetch dedup.
  • Agent-ready tooling support: provides scripts for frontend Lighthouse/bundle analysis and Go pprof extraction, plus language modules for runtime-specific commands.

Quick Start

Use the perf-optimization skill to analyze a slow page by first running the recommended profiling script, then applying one optimization at a time based on the profile findings and validating the result with before/after benchmarks.

Frequently Asked Questions about perf-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify CPU and memory bottlenecks using profiling data?

Profile-driven performance optimization identifies bottlenecks by extracting and interpreting signals like cumulative versus flat cost from CPU, heap, and trace data to distinguish user-land causes from runtime noise.

What's the best way to prioritize performance fixes from a profiling report?

The best way to prioritize performance fixes is ranking them by impact and risk, enforcing a decision rule like 'do first / do second / do last / skip' to prevent low-value tuning and focus on measurable speedups.

How do I optimize a slow web page using Lighthouse and bundle analysis?

To optimize a slow web page using Lighthouse and bundle analysis, run the recommended frontend profiling script to extract metrics, then apply targeted optimizations like vendor chunk partitioning one change at a time with before and after benchmarks.

Can I use this profile-driven optimization method for Go pprof trace analysis?

Yes, this profile-driven optimization method applies to Go pprof trace analysis by using provided extraction scripts and language-specific modules to investigate regressions and apply safe, test-backed code changes.

When should I stop optimizing a hot path during performance tuning?

You should stop optimizing a hot path during performance tuning when improvements fall below a meaningful threshold like less than five percent gain within noise, or when irreducible runtime floors dominate the remaining cost.

What common patterns help resolve frontend and backend performance bottlenecks?

Common patterns to resolve performance bottlenecks include caching, pre-allocation, fast-reject, pooling, batching, vendor chunk partitioning, and concurrent-fetch deduplication, which are applied as prioritized, test-backed code changes.