Communitygithub.com

성능 프로파일러 (Performance Profiler)

N+1 쿼리, 비효율적인 루프, 메모리 누수, 느린 알고리즘 등 성능 병목 현상을 식별합니다. 사용자가 성능 문제, 느린 코드, 최적화, 또는 프로파일링을 언급할 때 사용하세요.

성능 프로파일러 (Performance Profiler)란 무엇인가요?

이 스킬은 코드 내 흔한 성능 병목 지점을 찾아내고 구체적인 수정 방안을 제시하는 AI 어시스턴트용 성능 프로파일러입니다. 사용자가 성능 문제, 최적화 요청, 메모리 누수 등을 언급할 때 활성화되며, JavaScript, Python, React, 데이터베이스 등 다양한 기술 스택을 지원합니다. N+1 쿼리, O(n²) 중첩 루프, 불필요한 리렌더링, 메모리 누수, 동기식 블로킹 연산, 네트워크 비효율성 등 주요 안티패턴을 자동으로 식별합니다. 또한 EXPLAIN 명령어, 크롬 DevTools 성능 탭, cProfile 같은 프로파일링 도구 사용을 안내하고, 발견된 문제의 우선순위(심각/높음/중간)별로 정리된 성능 분석 리포트를 생성합니다. 프로파일링 전의 최적화, 80/20 법칙, 변경 사항의 측정 등 모범 사례도 강조합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/performance-profiler

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

성능 프로파일러

코드의 일반적인 성능 병목 현상을 식별하고 수정을 제안합니다.

사용 시기

  • 사용자가 성능 문제 또는 느린 코드를 보고하는 경우
  • 최적화 요청
  • 성능에 대한 코드 리뷰
  • 사용자가 "느린", "병목", "최적화", "메모리 누수"를 언급하는 경우

지침

1. 성능 안티패턴 식별

N+1 쿼리 문제:

// 나쁨: N+1 쿼리
users.forEach(user => {
  const posts = db.query('SELECT * FROM posts WHERE user_id = ?', user.id);
});

// 좋음: JOIN 단일 쿼리
const usersWithPosts = db.query('SELECT * FROM users LEFT JOIN posts ON users.id = posts.user_id');

비효율적인 루프:

# 나쁨: O(n²) 중첩 루프
for item in list1:
    for other in list2:
        if item.id == other.id:
            process(item, other)

# 좋음: O(n) 해시 맵 사용
lookup = {other.id: other for other in list2}
for item in list1:
    if item.id in lookup:
        process(item, lookup[item.id])

불필요한 리렌더링 (React):

// 나쁨: 매 렌더링마다 새 객체 생성
<Component style={{ margin: 10 }} />

// 좋음: 외부에 정의하거나 useMemo 사용
const style = { margin: 10 };
<Component style={style} />

메모리 누수:

  • 정리되지 않은 이벤트 리스너
  • 해제되지 않은 타이머
  • 순환 참조
  • 제한 없는 대용량 캐시

블로킹 연산:

  • 동기식 파일 I/O
  • UI 스레드에서의 장시간 계산
  • 페이지네이션 누락

2. 데이터베이스 성능

확인할 사항:

  • 외래 키에 인덱스 누락
  • 특정 컬럼 대신 SELECT * 사용
  • 루프 내 쿼리 (N+1)
  • 쿼리 제한 누락
  • 비효율적인 JOIN

제안:

  • 인덱스 추가: CREATE INDEX idx_user_id ON posts(user_id);
  • Eager 로딩/프리페칭 사용
  • 페이지네이션 구현
  • 데이터베이스 쿼리 분석기 사용 (EXPLAIN)

3. 알고리즘 복잡도

식별:

  • O(n²) 이상의 알고리즘
  • 중복 계산
  • 불필요한 정렬
  • 비효율적인 자료 구조

일반적인 수정:

  • 배열 탐색 O(n) 대신 해시 맵으로 O(1) 조회
  • 선형 탐색 O(n) 대신 이진 탐색 O(log n)
  • 반복 계산에 메모이제이션
  • 비용이 큰 연산에 지연 평가

4. 프론트엔드 성능

확인할 사항:

  • 큰 번들 크기
  • 최적화되지 않은 이미지
  • 코드 분할 누락
  • 비효율적인 React 컴포넌트
  • 메모이제이션 누락

제안:

  • 지연 로딩: const Component = lazy(() => import('./Component'));
  • 이미지 최적화
  • 비용이 큰 연산에 디바운스/스로틀
  • 긴 리스트에 가상 스크롤
  • 무거운 계산에 Web Worker 사용

5. 네트워크 성능

문제점:

  • 너무 많은 HTTP 요청
  • 큰 페이로드
  • 캐싱 누락
  • 동기식 요청

해결책:

  • 리소스 번들/연결
  • 압축 구현 (gzip, brotli)
  • HTTP/2 멀티플렉싱 사용
  • 캐싱 헤더 추가
  • 병렬 vs 순차 요청

6. 성능 리포트 생성

성능 분석
===========

심각한 문제 (즉시 수정):
1. UserController.index의 N+1 쿼리 (file.js:45)
   - 영향: 요청당 100개 이상의 DB 쿼리
   - 수정: Eager 로딩 또는 JOIN 사용

2. EventEmitter의 메모리 누수 (file.js:120)
   - 영향: 메모리가 무제한으로 증가
   - 수정: 정리 시 리스너 제거

높은 우선순위:
3. processData의 O(n²) 루프 (file.js:200)
   - 영향: 대용량 데이터셋에서 느림
   - 수정: 해시 맵을 사용하여 O(n)으로 변경

중간 우선순위:
4. 이미지 최적화 누락
   - 영향: 페이지 로드 속도 저하
   - 수정: next/image 사용 또는 수동 최적화

7. 프로파일링 도구

JavaScript:

  • Chrome DevTools 성능 탭
  • Node.js --inspect 플래그
  • console.time() / console.timeEnd()

Python:

  • cProfile 모듈
  • line_profiler
  • memory_profiler

데이터베이스:

  • EXPLAIN / EXPLAIN ANALYZE
  • 슬로우 쿼리 로그
  • pg_stat_statements (PostgreSQL)

모범 사례

  • 최적화 전에 프로파일링 수행
  • 핫 패스 집중 (80/20 법칙)
  • 변경 사항의 영향 측정
  • 가독성과 성능 간의 트레이드오프 고려
  • 성능이 중요한 섹션 문서화

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬