본문으로 건너뛰기
Skillpedia
일반 코딩107k · #778

performance-optimization

하는 일

애플리케이션의 느린 부분을 찾아 고치도록 돕는 도구입니다. 성능을 측정하고, 병목 지점을 찾고, 고치는 방법을 제안해 사용자에게 더 빠르게 작동하도록 합니다.

사용하는 경우

  • ✓애플리케이션이 로드되는 데 너무 오래 걸릴 때.
  • ✓사용자가 느리다고 불평할 때.
  • ✓Core Web Vitals 같은 성능 지표가 낮을 때.

스킬 링크

https://github.com/addyosmani/agent-skills/blob/main/skills/performance-optimization/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/addyosmani/agent-skills/blob/main/skills/performance-optimization/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“웹사이트 로딩이 너무 오래 걸립니다. 성능을 최적화하도록 도와주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 먼저 애플리케이션의 현재 성능을 측정해 문제가 어디에 있는지 파악합니다. 그다음 다른 것은 바꾸지 않고 그 특정 지점을 고치는 데 집중하며, 개선이 실제로 있었는지 검증합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Performance Optimization

Overview

Measure before optimizing. Performance work without measurement is guessing — and guessing leads to premature optimization that adds complexity without improving what matters. Profile first, identify the actual bottleneck, fix it, measure again. Optimize only what measurements prove matters.

When to Use

  • Performance requirements exist in the spec (load time budgets, response time SLAs)
  • Users or monitoring report slow behavior
  • Core Web Vitals scores are below thresholds
  • You suspect a change introduced a regression
  • Building features that handle large datasets or high traffic

When NOT to use: Don't optimize before you have evidence of a problem. Premature optimization adds complexity that costs more than the performance it gains.

Core Web Vitals Targets

Metric Good Needs Improvement Poor
LCP (Largest Contentful Paint) ≤ 2.5s ≤ 4.0s > 4.0s
INP (Interaction to Next Paint) ≤ 200ms ≤ 500ms > 500ms
CLS (Cumulative Layout Shift) ≤ 0.1 ≤ 0.25 > 0.25

The Optimization Workflow

1. MEASURE  → Establish baseline with real data
2. IDENTIFY → Find the actual bottleneck (not assumed)
3. FIX      → Address the specific bottleneck
4. VERIFY   → Measure again; keep or revert
5. GUARD    → Add monitoring or tests to prevent regression

Step 1: Measure

Two complementary approaches — use both:

  • Synthetic (Lighthouse, DevTools Performance tab): Controlled conditions, reproducible. Best for CI regression detection and isolating specific issues.
  • RUM (web-vitals library, CrUX): Real user data in real conditions. Required to validate that a fix actually improved user experience.

Frontend:

// Synthetic: Lighthouse in Chrome DevTools (or CI)
// Chrome DevTools → Performance tab → Record
// Chrome DevTools MCP → Performance trace

// RUM: Web Vitals library in code
import { onLCP, onINP, onCLS } from 'web-vitals';

onLCP(console.log);
onINP(console.log);
onCLS(console.log);

Backend:

// Response time logging
// Application Performance Monitoring (APM)
// Database query logging with timing

// Simple timing
console.time('db-query');
const result = await db.query(...);
console.timeEnd('db-query');

Where to Start Measuring

Use the symptom to decide what to measure first:

What is slow?
├── First page load
│   ├── Large bundle? --> Measure bundle size, check code splitting
│   ├── Slow server response? --> Measure TTFB in DevTools Network waterfall
│   │   ├── DNS long? --> Add dns-prefetch / preconnect for known origins
│   │   ├── TCP/TLS long? --> Enable HTTP/2, check edge deployment, keep-alive
│   │   └── Waiting (server) long? --> Profile backend, check queries and caching
│   └── Render-blocking resources? --> Check network waterfall for CSS/JS blocking
├── Interaction feels sluggish
│   ├── UI freezes on click? --> Profile main thread, look for long tasks (>50ms)
│   ├── Form input lag? --> Check re-renders, controlled component overhead
│   └── Animation jank? --> Check layout thrashing, forced reflows
├── Page after navigation
│   ├── Data loading? --> Measure API response times, check for waterfalls
│   └── Client rendering? --> Profile component render time, check for N+1 fetches
└── Backend / API
    ├── Single endpoint slow? --> Profile database queries, check indexes
    ├── All endpoints slow? --> Check connection pool, memory, CPU
    └── Intermittent slowness? --> Check for lock contention, GC pauses, external deps

Step 2: Identify the Bottleneck

Common bottlenecks by category:

Frontend:

Symptom Likely Cause Investigation
Slow LCP Large images, render-blocking resources, slow server Check network waterfall, image sizes
High CLS Images without dimensions, late-loading content, font shifts Check layout shift attribution
Poor INP Heavy JavaScript on main thread, large DOM updates Check long tasks in Performance trace
Slow initial load Large bundle, many network requests Check bundle size, code splitting

Backend:

Symptom Likely Cause Investigation
Slow API responses N+1 queries, missing indexes, unoptimized queries Check database query log
Memory growth Leaked references, unbounded caches, large payloads Heap snapshot analysis

…

자주 묻는 질문

Core Web Vitals란 무엇인가요?

페이지 로딩 속도, 상호작용성, 시각적 안정성 등 사용자 경험을 측정하는 지표입니다.

성능 병목이란 무엇인가요?

애플리케이션 전체를 느리게 만드는 원인이 되는 부분입니다. 예를 들어 느린 데이터베이스 쿼리나 처리에 오래 걸리는 코드가 있습니다.

측정하기 전에 최적화해야 하나요?

아니요. 문제가 정확히 어디에 있는지 알려면 먼저 측정하는 것이 중요합니다. 측정 없이 최적화하면 상황을 더 나쁘게 하거나 불필요한 복잡성을 더할 수 있습니다.

상세 정보

작성자의 원본 설명

Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.

repo: addyosmani/agent-skills

인기도

GitHub 스타
107k
순위
#778
라이선스
MIT
업데이트
2026. 10. 13.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬