Communitygithub.com

Leistungsprofi

Identifiziert Leistungsengpässe in Code, wie N+1-Abfragen, ineffiziente Schleifen, Speicherlecks und langsame Algorithmen. Verwenden Sie dies, wenn der Benutzer von Leistungsproblemen, langsamem Code, Optimierung oder Profiling spricht.

Was ist Leistungsprofi?

Die Fähigkeit 'Leistungsprofi' ist ein umfassendes Tool für KI-Agenten, das entwickelt wurde, um Leistungsengpässe in Codebasen zu identifizieren und zu beheben. Es deckt eine breite Palette von Antipatterns ab, darunter N+1-Abfrageprobleme, ineffiziente Schleifen mit O(n²)-Komplexität, unnötige Neu-Renderings in React, Speicherlecks durch nicht bereinigte Ereignis-Listener oder Timer, blockierende Operationen wie synchrone Datei-E/A sowie Frontend-Probleme wie große Bundle-Größen und fehlende Bildoptimierung. Die SKILL.md beschreibt detailliert, wie diese Muster erkannt werden, und bietet konkrete Korrekturen, beispielsweise die Verwendung von Hash-Maps zur Reduzierung der Komplexität, Eager-Loading für Datenbankabfragen oder Lazy-Loading für React-Komponenten. Der Agent kann einen strukturierten Leistungsbericht mit priorisierten Problemen, Auswirkungen und empfohlenen Korrekturen generieren und dabei Profiling-Tools für JavaScript (Chrome DevTools, Node.js --inspect), Python (cProfile, memory_profiler) und Datenbanken (EXPLAIN, Slow Query Log) empfehlen. Die Fähigkeit betont die Wichtigkeit von Profiling vor der Optimierung, die Konzentration auf heiße Pfade (80/20-Regel) und die Messung von Änderungsauswirkungen, um Lesbarkeit und Leistung in Einklang zu bringen.

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

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht Leistungsprofi?

Identifiziert und schlägt Korrekturen für häufige Leistungsengpässe in Code vor.

Wann zu verwenden

  • Benutzer meldet Leistungsprobleme oder langsamen Code
  • Optimierungsanfragen
  • Code-Review für Leistung
  • Benutzer erwähnt "langsam", "Engpass", "Optimierung", "Speicherleck"

Anweisungen

1. Identifizieren von Leistungs-Antipatterns

N+1-Abfrageprobleme:

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

// Gut: Einzelne Abfrage mit JOIN
const usersWithPosts = db.query('SELECT * FROM users LEFT JOIN posts ON users.id = posts.user_id');

Ineffiziente Schleifen:

# Schlecht: O(n²) verschachtelte Schleifen
for item in list1:
    for other in list2:
        if item.id == other.id:
            process(item, other)

# Gut: O(n) mit Hash-Map
lookup = {other.id: other for other in list2}
for item in list1:
    if item.id in lookup:
        process(item, lookup[item.id])

Unnötige Neu-Renderings (React):

// Schlecht: Erzeugt bei jedem Rendern ein neues Objekt
<Component style={{ margin: 10 }} />

// Gut: Außerhalb definieren oder useMemo verwenden
const style = { margin: 10 };
<Component style={style} />

Speicherlecks:

  • Ereignis-Listener nicht bereinigt
  • Timer nicht gelöscht
  • Zirkuläre Referenzen
  • Große Caches ohne Limits

Blockierende Operationen:

  • Synchrone Datei-I/O
  • Langlaufende Berechnungen im UI-Thread
  • Fehlende Paginierung

2. Datenbankleistung

Prüfen auf:

  • Fehlende Indizes auf Fremdschlüsseln
  • SELECT * statt spezifischer Spalten
  • Abfragen in Schleifen (N+1)
  • Fehlende Abfragelimits
  • Ineffiziente JOINs

Vorschlagen:

  • Indizes hinzufügen: CREATE INDEX idx_user_id ON posts(user_id);
  • Eager Loading / Prefetching verwenden
  • Paginierung implementieren
  • Datenbankabfrageanalysatoren (EXPLAIN) verwenden

3. Algorithmenkomplexität

Identifizieren:

  • O(n²) oder schlechtere Algorithmen
  • Redundante Berechnungen
  • Unnötiges Sortieren
  • Ineffiziente Datenstrukturen

Häufige Korrekturen:

  • Hash-Maps für O(1)-Lookup vs. O(n)-Arraysuche
  • Binäre Suche O(log n) vs. lineare Suche O(n)
  • Memoization für wiederholte Berechnungen
  • Faule Auswertung für teure Operationen

4. Frontend-Leistung

Prüfen auf:

  • Große Bundle-Größen
  • Nicht optimierte Bilder
  • Fehlendes Code-Splitting
  • Ineffiziente React-Komponenten
  • Fehlende Memoization

Vorschlagen:

  • Lazy Loading: const Component = lazy(() => import('./Component'));
  • Bildoptimierung
  • Debounce/Throttle teurer Operationen
  • Virtuelles Scrollen für lange Listen
  • Web Worker für schwere Berechnungen

5. Netzwerkleistung

Probleme:

  • Zu viele HTTP-Anfragen
  • Große Payloads
  • Fehlendes Caching
  • Synchrone Anfragen

Lösungen:

  • Ressourcen bündeln/verketten
  • Komprimierung implementieren (gzip, brotli)
  • HTTP/2-Multiplexing verwenden
  • Caching-Header hinzufügen
  • Parallele vs. sequenzielle Anfragen

6. Leistungsbericht erstellen

Leistungsanalyse
===================

Kritische Probleme (Sofort beheben):
1. N+1 Abfrage in UserController.index (file.js:45)
   - Auswirkung: 100+ DB-Abfragen pro Anfrage
   - Korrektur: Eager Loading oder JOIN verwenden

2. Speicherleck in EventEmitter (file.js:120)
   - Auswirkung: Speicher wächst unbegrenzt
   - Korrektur: Listener beim Aufräumen entfernen

Hohe Priorität:
3. O(n²)-Schleife in processData (file.js:200)
   - Auswirkung: Langsam für große Datensätze
   - Korrektur: Hash-Map für O(n) verwenden

Mittlere Priorität:
4. Fehlende Bildoptimierung
   - Auswirkung: Langsamer Seitenaufbau
   - Korrektur: next/image verwenden oder manuell optimieren

7. Profiling-Tools

JavaScript:

  • Chrome DevTools Performance-Tab
  • Node.js --inspect-Flag
  • console.time() / console.timeEnd()

Python:

  • cProfile-Modul
  • line_profiler
  • memory_profiler

Datenbank:

  • EXPLAIN / EXPLAIN ANALYZE
  • Slow Query Log
  • pg_stat_statements (PostgreSQL)

Best Practices

  • Vor der Optimierung profilieren
  • Auf heiße Pfade konzentrieren (80/20-Regel)
  • Auswirkungen von Änderungen messen
  • Lesbarkeit vs. Leistung abwägen
  • Leistungskritische Abschnitte dokumentieren

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

Verwandte Skills