Token导航 LogoToken导航

Agent Skill · 研究检索

performance-profiler(性能分析器)

performance-profiler 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

performance-profiler 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 39,839。

总安装 1,360周安装 55GitHub Stars 103下载 427核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:performance-profiler(性能分析器)
来源仓库:https://github.com/borghei/claude-skills
仓库路径:skills/performance-profiler
安装命令:
npx skills add https://github.com/borghei/claude-skills --skill performance-profiler
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/borghei/claude-skills --skill performance-profiler

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

performance-profiler 系统化分析 Node.js、Python、Go 应用的性能瓶颈,识别 CPU、内存与数据库问题。支持火焰图生成、内存泄漏检测、Bundle 分析及 k6/Artillery 负载测试。强制执行“测量-定位-修复-验证”闭环,避免盲目优化。

运行测试前需准备稳定环境,防止本地模拟干扰真实性能表现。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/performance-profiler

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/borghei/claude-skills --skill performance-prof…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

performance-profiler 怎么安装?

在终端执行 npx skills add https://github.com/borghei/claude-skills --skill performance-profiler。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

performance-profiler 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

performance-profiler 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

performance-profiler 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

performance-profiler 用的人多吗?

公开数据是累计安装 1,360 次,近一周安装 55 次,下载 427 次,GitHub 103 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

performance-profiler 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
performance-profiler

性能分析器 · 本页

1,360103接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Performance Profiler

Tier: POWERFUL Category: Engineering / Performance Maintainer: Claude Skills Team

Overview

Systematic performance profiling for Node.js, Python, and Go applications. Identifies CPU bottlenecks with flamegraphs, detects memory leaks with heap snapshots, analyzes bundle sizes, optimizes database queries, detects N+1 patterns, and runs load tests with k6 and Artillery. Enforces a measure-first methodology: establish baseline, identify bottleneck, fix, and verify improvement.

Keywords

performance profiling, flamegraph, memory leak, bundle analysis, N+1 queries, load testing, k6, latency, P99, CPU profiling, heap snapshot, database optimization

Golden Rule: Measure First

WRONG: "I think the N+1 query is slow, let me fix it"
RIGHT: Profile → Confirm bottleneck → Fix → Measure again → Verify improvement

Every optimization must have:
1. Baseline metrics (before)
2. Profiler evidence (what's actually slow)
3. The fix
4. Post-fix metrics (after)
5. Delta calculation (improvement %)

Core Capabilities

1. CPU Profiling

  • Node.js: Clinic.js flamegraphs, V8 CPU profiles
  • Python: py-spy flamegraphs, cProfile, scalene
  • Go: pprof CPU profiles, trace visualization
  • Browser: Chrome DevTools Performance panel

2. Memory Profiling

  • Heap snapshots and comparison (before/after)
  • Garbage collection pressure analysis
  • Memory leak detection patterns
  • Retained object graph analysis

3. Database Optimization

  • EXPLAIN ANALYZE for query plan analysis
  • N+1 query detection and batching
  • Slow query log analysis
  • Missing index identification
  • Connection pool sizing

4. Bundle Analysis

  • webpack-bundle-analyzer visualization
  • Next.js bundle analyzer
  • Tree-shaking effectiveness
  • Dynamic import opportunities
  • Heavy dependency identification

5. Load Testing

  • k6 scripts with ramp-up patterns
  • SLA threshold enforcement in CI
  • Latency percentile tracking (P50, P95, P99)
  • Concurrent user simulation

When to Use

  • App is slow and you do not know where the bottleneck is
  • P99 latency exceeds SLA before a release
  • Memory usage grows over time (suspected leak)
  • Bundle size increased after adding dependencies
  • Preparing for a traffic spike (load test before launch)
  • Database queries taking >100ms
  • After a dependency upgrade to verify no regressions

Node.js CPU Profiling

Method 1: Clinic.js Flamegraph

# Install
npm install -g clinic

# Generate flamegraph (starts server, applies load, generates HTML report)
clinic flame -- node server.js

# With specific load profile
clinic flame --autocannon [ /api/endpoint -c 10 -d 30 ] -- node server.js

# Analyze specific scenario
clinic flame --on-port 'autocannon -c 50 -d 60 http://localhost:$PORT/api/heavy-endpoint' -- node server.js

Method 2: V8 CPU Profile

# Start Node with inspector
node --inspect server.js

# Or profile on demand
node --cpu-prof --cpu-prof-dir=./profiles server.js
# Load the .cpuprofile file in Chrome DevTools > Performance

# Programmatic profiling of a specific function
const { Session } = require('inspector');
const session = new Session();
session.connect();

session.post('Profiler.enable', () => {
  session.post('Profiler.start', () => {
    // Run the code you want to profile
    runHeavyOperation();

    session.post('Profiler.stop', (err, { profile }) => {
      require('fs').writeFileSync('profile.cpuprofile', JSON.stringify(profile));
    });
  });
});

Memory Leak Detection

Node.js Heap Snapshots

// Take heap snapshots programmatically
const v8 = require('v8');
const fs = require('fs');

function takeHeapSnapshot(label) {
  const snapshotPath = `heap-${label}-${Date.now()}.heapsnapshot`;
  const stream = v8.writeHeapSnapshot(snapshotPath);
  console.log(`Heap snapshot written to: ${snapshotPath}`);
  return snapshotPath;
}

// Leak detection pattern: compare two snapshots
// 1. Take snapshot at startup
takeHeapSnapshot('baseline');

// 2. Run operations that you suspect leak
// ... process 1000 requests ...

// 3. Force GC and take another snapshot
if (global.gc) global.gc(); // requires --expose-gc flag
takeHeapSnapshot('after-load');

// Load both .heapsnapshot files in Chrome DevTools > Memory
// Use "Comparison" view to find objects that grew

Python Memory Profiling

# Install tracemalloc-based profiler
pip install memray

# Profile a script
memray run my_script.py
memray flamegraph memray-output.bin -o flamegraph.html

# Profile a specific function
python -c "
import tracemalloc
tracemalloc.start()

# Run your code
from my_module import heavy_function
heavy_function()

snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')
print('Top 10 memory allocations:')
for stat in top_stats[:10]:
    print(stat)
"

Database Query Optimization

EXPLAIN ANALYZE Workflow

-- Step 1: Get the actual execution plan (not just estimated)
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT t.*, p.name as project_name
FROM tasks t
JOIN projects p ON p.id = t.project_id
WHERE p.workspace_id = 'ws_abc123'
  AND t.status = 'in_progress'
  AND t.deleted_at IS NULL
ORDER BY t.updated_at DESC
LIMIT 20;

-- What to look for in the output:
-- Seq Scan on tasks  → MISSING INDEX (should be Index Scan)
-- Rows Removed by Filter: 99000  → INDEX NOT SELECTIVE ENOUGH
-- Sort Method: external merge  → NOT ENOUGH work_mem
-- Nested Loop with inner Seq Scan  → MISSING INDEX ON JOIN COLUMN
-- Actual rows=1000 vs estimated rows=1  → STALE STATISTICS (run ANALYZE)

N+1 Query Detection

// PROBLEM: N+1 query pattern
async function getProjectsWithTasks(workspaceId: string) {
  const projects = await db.query.projects.findMany({
    where: eq(projects.workspaceId, workspaceId),
  });

  // This executes N additional queries (one per project)
  for (const project of projects) {
    project.tasks = await db.query.tasks.findMany({
      where: eq(tasks.projectId, project.id),
    });
  }
  return projects;
}
// Total queries: 1 + N (where N = number of projects)

// FIX: Single query with JOIN or relation loading
async function getProjectsWithTasks(workspaceId: string) {
  return db.query.projects.findMany({
    where: eq(projects.workspaceId, workspaceId),
    with: {
      tasks: true,  // Drizzle generates a single JOIN or subquery
    },
  });
}
// Total queries: 1-2 (depending on ORM strategy)

N+1 Detection Script

# Log query count per request (add to middleware)
# Node.js with Drizzle:
let queryCount = 0;
const originalQuery = db.execute;
db.execute = (...args) => { queryCount++; return originalQuery.apply(db, args); };

// After request completes:
if (queryCount > 10) {
  console.warn(`N+1 ALERT: ${req.method} ${req.path} executed ${queryCount} queries`);
}

Bundle Analysis

Next.js Bundle Analyzer

# Install
pnpm add -D @next/bundle-analyzer

# next.config.js
const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer(nextConfig);

# Run analysis
ANALYZE=true pnpm build
# Opens browser with interactive treemap

Quick Bundle Size Check

# Check what you're shipping
npx source-map-explorer .next/static/chunks/*.js

# Size of individual imports
npx import-cost  # VS Code extension for inline size

# Find heavy dependencies
npx depcheck --json | jq '.dependencies'
npx bundlephobia-cli <package-name>

Common Bundle Wins

BeforeAfterSavings
import _ from 'lodash'import groupBy from 'lodash/groupBy'~70KB
import moment from 'moment'import {format} from 'date-fns'~60KB
import {icons} from 'lucide-react'import {Search} from 'lucide-react'~50KB
Static import of heavy componentdynamic(() => import('./HeavyChart'))Deferred
All routes in one chunkCode splitting per route (automatic in Next.js)Per-route

Load Testing with k6

// load-test.k6.js
import http from 'k6/http'
import { check, sleep } from 'k6'
import { Trend, Rate } from 'k6/metrics'

const apiLatency = new Trend('api_latency')
const errorRate = new Rate('errors')

export const options = {
  stages: [
    { duration: '1m', target: 20 },    // ramp up
    { duration: '3m', target: 100 },   // sustain
    { duration: '1m', target: 0 },     // ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<200', 'p(99)<500'],
    errors: ['rate<0.01'],
    api_latency: ['p(95)<150'],
  },
}

export default function () {
  const res = http.get(`${__ENV.BASE_URL}/api/v1/projects?limit=20`, {
    headers: { Authorization: `Bearer ${__ENV.TOKEN}` },
  })

  apiLatency.add(res.timings.duration)
  check(res, {
    'status 200': (r) => r.status === 200,
    'body has data': (r) => JSON.parse(r.body).data !== undefined,
  }) || errorRate.add(1)

  sleep(1)
}
# Run locally
k6 run load-test.k6.js -e BASE_URL=http://localhost:3000 -e TOKEN=$TOKEN

# Run with cloud reporting
k6 cloud load-test.k6.js

Before/After Measurement Template

## Performance Optimization: [What You Fixed]

**Date:** YYYY-MM-DD
**Ticket:** PROJ-123

### Problem
[1-2 sentences: what was slow, how it was observed]

### Root Cause
[What the profiler revealed — include flamegraph link or screenshot]

### Baseline (Before)
| Metric | Value |
|--------|-------|
| P50 latency | XXms |
| P95 latency | XXms |
| P99 latency | XXms |
| Throughput (RPS) | XX |
| DB queries/request | XX |
| Bundle size | XXkB |

### Fix Applied
[Brief description + link to PR]

### After
| Metric | Before | After | Delta |
|--------|--------|-------|-------|
| P50 | XXms | XXms | -XX% |
| P95 | XXms | XXms | -XX% |
| P99 | XXms | XXms | -XX% |
| RPS | XX | XX | +XX% |
| DB queries/req | XX | XX | -XX% |

### Verification
[Link to k6 output, CI run, or monitoring dashboard]

Quick-Win Optimization Checklist

DATABASE
[ ] Missing indexes on WHERE/ORDER BY columns
[ ] N+1 queries (check query count per request)
[ ] SELECT * when only 2-3 columns needed
[ ] No LIMIT on unbounded queries
[ ] Missing connection pool (new connection per request)
[ ] Stale statistics (run ANALYZE on busy tables)

NODE.JS
[ ] Sync I/O (fs.readFileSync) in request handlers
[ ] JSON.parse/stringify of large objects in hot loops
[ ] Missing response compression (gzip/brotli)
[ ] Dependencies loaded inside request handlers (move to module level)
[ ] Sequential awaits that could be Promise.all

BUNDLE
[ ] Full lodash/moment import instead of specific functions
[ ] Static imports of heavy components (use dynamic import)
[ ] Images not optimized / not using next/image
[ ] No code splitting on routes

API
[ ] No pagination on list endpoints
[ ] No Cache-Control headers on stable responses
[ ] Serial fetches that could run in parallel
[ ] Fetching related data in loops instead of JOINs

Common Pitfalls

  • Optimizing without measuring — you will optimize the wrong thing
  • Testing with development data — 10 rows in dev vs millions in prod reveals different bottlenecks
  • Ignoring P99 — P50 can look fine while P99 is catastrophic for some users
  • Premature optimization — fix correctness first, then measure and optimize
  • Not re-measuring after the fix — always verify the fix actually improved the metrics
  • Load testing production — use staging with production-sized data volumes instead

Best Practices

  1. Baseline first, always — record P50/P95/P99, RPS, and error rate before touching anything
  2. One change at a time — isolate the variable to confirm causation, not correlation
  3. Profile with realistic data volumes — performance characteristics change dramatically with scale
  4. Set performance budgets — p(95) < 200ms as a CI gate with k6
  5. Monitor continuously — add Datadog/Prometheus/Grafana metrics for key code paths
  6. Cache aggressively, invalidate precisely — cache is the fastest optimization but hardest to debug
  7. Document the win — before/after in the PR description motivates the team and creates institutional knowledge

Troubleshooting

ProblemCauseSolution
Flamegraph shows only (idle) framesProfiling during low-load period; no meaningful CPU work capturedApply realistic load with autocannon or k6 during profiling, target the specific endpoint under investigation
Heap snapshot comparison shows no growth but memory still climbsNative memory leak outside V8 heap (e.g., native addon, file descriptor leak)Use process.memoryUsage().rss tracking alongside heap snapshots; profile with Valgrind or memray for native allocations
EXPLAIN ANALYZE shows Index Scan but query is still slowIndex exists but is not selective enough, or query returns too many rows for index to helpCheck index selectivity with SELECT count(DISTINCT col)/count(*) FROM table; consider composite index or partial index
k6 load test passes locally but fails in CICI runner has limited CPU/memory; network latency differs from localRun k6 against a dedicated staging environment, not localhost in CI; adjust thresholds for CI-specific baselines
Bundle analyzer shows expected size but app still loads slowlyLarge bundle is code-split but critical path has render-blocking resourcesAudit the critical rendering path separately with Lighthouse; check for synchronous scripts and unoptimized images
py-spy cannot attach to running processInsufficient permissions or SIP (System Integrity Protection) on macOSRun with sudo py-spy record --pid <PID>; on macOS, disable SIP or use --subprocesses flag with a fresh process
N+1 detection middleware reports false positivesLegitimate batch operations trigger high query counts per requestAdd endpoint-level allowlists to the detection middleware; distinguish between N+1 patterns and intentional batch queries by checking for repeated identical query templates

Success Criteria

  • Baseline coverage: Every optimization PR includes documented before/after metrics with P50, P95, and P99 latency values
  • Latency targets met: P95 API response time stays below 200ms and P99 below 500ms as validated by k6 threshold checks in CI
  • Memory stability: No heap growth exceeding 10% over a 24-hour soak test under sustained load
  • Bundle budget enforced: JavaScript bundle size for initial page load remains under 200kB gzipped, verified by CI gate
  • N+1 elimination: Query count per API request stays below 10 for all critical endpoints, validated by request-level query logging
  • Load test confidence: Staging load tests demonstrate the system handles 2x expected peak traffic with error rate below 1%
  • Regression detection: Performance regressions are caught within one CI cycle, not discovered in production monitoring

Scope & Limitations

This skill covers:

  • CPU and memory profiling for Node.js, Python, and Go applications using flamegraphs and heap snapshots
  • Database query optimization including EXPLAIN ANALYZE interpretation, N+1 detection, and index recommendations
  • Frontend bundle analysis and size reduction strategies for webpack and Next.js projects
  • Load testing methodology with k6 including ramp-up patterns, threshold enforcement, and CI integration

This skill does NOT cover:

  • Application Performance Monitoring (APM) platform setup and configuration (Datadog, New Relic, Grafana) — see engineering/observability-designer
  • Infrastructure-level performance tuning (kernel parameters, network stack, container resource limits) — see engineering/senior-devops
  • Security-focused performance concerns such as DDoS mitigation or rate limiting — see engineering/senior-security
  • Mobile application profiling (iOS Instruments, Android Profiler) — see engineering/senior-mobile

Integration Points

SkillIntegrationData Flow
engineering/observability-designerPerformance profiling findings feed into observability dashboard design; alerting thresholds derived from profiling baselinesProfiler baselines and SLA thresholds → Prometheus/Grafana alert rules and dashboard panels
engineering/ci-cd-pipeline-builderk6 load tests and bundle size checks integrate as CI pipeline gatesk6 threshold configs and bundle budget scripts → CI pipeline stage definitions
engineering/database-designerQuery optimization recommendations inform schema design decisions; index suggestions feed back to schema migrationsEXPLAIN ANALYZE findings and index recommendations → schema migration files and index definitions
engineering/senior-backendBackend architecture decisions incorporate profiling data; connection pool sizing and caching strategies validated by load testsProfiling reports and load test results → architecture decision records and implementation guidance
engineering/tech-debt-trackerPerformance regressions and unresolved bottlenecks are tracked as technical debt items with measured impactBefore/after measurement reports and unresolved findings → tech debt backlog with quantified cost
engineering/senior-frontendBundle analysis results drive frontend optimization work; code-splitting and lazy-loading decisions backed by profiler dataBundle analyzer output and Lighthouse scores → frontend optimization tasks and component refactoring plans

平台分布

Codex

34.18%
按下载量换算146

Claude

29.45%
按下载量换算126

Cursor

21.58%
按下载量换算92

Gemini CLI

10.15%
按下载量换算43

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills