Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计异常

performance-engineering性能工程

Agent Skill

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

总安装

674

周安装

27

GitHub Stars

350

下载量

218
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill performance-engineering

简介

用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否会触发联网或文件读写。
  • 注意避免对生产环境造成影响。performance-engineering 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Performance Engineering

Purpose

Performance engineering encompasses load testing, profiling, and optimization to deliver reliable, scalable systems. This skill provides frameworks for choosing the right performance testing approach (load, stress, soak, spike), profiling techniques to identify bottlenecks (CPU, memory, I/O), and optimization strategies for backend APIs, databases, and frontend applications.

Use this skill to validate system capacity before launch, detect performance regressions in CI/CD pipelines, identify and resolve bottlenecks through profiling, and optimize application responsiveness across the stack.

When to Use This Skill

Common Triggers:

  • "Validate API can handle expected traffic"
  • "Find maximum capacity and breaking points"
  • "Identify why the application is slow"
  • "Detect memory leaks or resource exhaustion"
  • "Optimize Core Web Vitals for SEO"
  • "Set up performance testing in CI/CD"
  • "Reduce cloud infrastructure costs"

Use Cases:

  • Pre-launch capacity planning and load validation
  • Post-refactor performance regression testing
  • Investigating slow response times or high latency
  • Detecting memory leaks in long-running services
  • Optimizing database query performance
  • Validating auto-scaling configuration
  • Establishing performance SLOs and budgets

Performance Testing Types

Load Testing

Validate system behavior under expected traffic levels.

When to use: Pre-launch capacity planning, regression testing after refactors, validating auto-scaling.

Stress Testing

Find system capacity limits and failure modes.

When to use: Capacity planning, understanding failure behavior, infrastructure sizing decisions.

Soak Testing

Identify memory leaks, resource exhaustion, and degradation over time.

When to use: Detecting memory leaks, validating connection pool cleanup, testing long-running batch jobs.

Spike Testing

Validate system response to sudden traffic spikes.

When to use: Validating auto-scaling, testing event-driven systems (product launches), ensuring rate limiting works.

Quick Decision Framework

Which test type to use?

What am I trying to learn?
├─ Can my system handle expected traffic? → LOAD TEST
├─ What's the maximum capacity? → STRESS TEST
├─ Will it stay stable over time? → SOAK TEST
└─ Can it handle traffic spikes? → SPIKE TEST

For detailed testing patterns, load scenarios, and interpreting results, see references/testing-types.md.

Load Testing Quick Starts

k6 (JavaScript)

Installation:

brew install k6  # macOS
sudo apt-get install k6  # Linux

Basic Load Test:

import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '30s', target: 20 },
    { duration: '1m', target: 20 },
    { duration: '30s', target: 0 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<500'],
    http_req_failed: ['rate<0.01'],
  },
};

export default function () {
  const res = http.get('https://api.example.com/products');
  check(res, {
    'status is 200': (r) => r.status === 200,
  });
  sleep(1);
}

Run: k6 run script.js

For stress, soak, and spike testing examples, see examples/k6/.

Locust (Python)

Installation:

pip install locust

Basic Load Test:

from locust import HttpUser, task, between

class WebsiteUser(HttpUser):
    wait_time = between(1, 3)
    host = "https://api.example.com"

    @task(3)
    def view_products(self):
        self.client.get("/products")

    @task(1)
    def view_product_detail(self):
        self.client.get("/products/123")

Run: locust -f locustfile.py --headless -u 100 -r 10 --run-time 10m

For REST API testing and data-driven testing, see examples/locust/.

Profiling Quick Starts

When to Profile

SymptomProfiling TypeTool
High CPU (>70%)CPU Profilingpy-spy, pprof, DevTools
Memory growingMemory Profilingmemory_profiler, pprof heap
Slow response, low CPUI/O ProfilingQuery logs, pprof block

Python Profiling

py-spy (Production-Safe):

pip install py-spy

# Profile running process
py-spy record -o profile.svg --pid <PID> --duration 30

# Top-like view
py-spy top --pid <PID>

Memory Profiling:

from memory_profiler import profile

@profile
def my_function():
    a = [1] * (10 ** 6)
    return a

# Run: python -m memory_profiler script.py

Go Profiling

pprof (Built-in):

import (
    "net/http"
    _ "net/http/pprof"
)

func main() {
    go func() {
        http.ListenAndServe("localhost:6060", nil)
    }()
    startApp()
}

Capture profile:

# CPU profile (30 seconds)
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30

# Interactive analysis
(pprof) top
(pprof) web

TypeScript/JavaScript Profiling

Chrome DevTools (Browser/Node.js):

Node.js:

node --inspect app.js
# Open chrome://inspect
# Performance tab → Record

clinic.js (Node.js):

npm install -g clinic
clinic doctor -- node app.js

For detailed profiling workflows and analysis, see references/profiling-guide.md and examples/profiling/.

Optimization Strategies

Caching

When to cache:

  • Data queried frequently (>100 req/min)
  • Data freshness tolerance (>1 minute acceptable staleness)

Redis example:

import redis
r = redis.Redis()

def get_cached_data(key, fn, ttl=300):
    cached = r.get(key)
    if cached:
        return json.loads(cached)
    data = fn()
    r.setex(key, ttl, json.dumps(data))
    return data

Database Query Optimization

N+1 prevention:

# Bad: N+1 queries
users = User.query.all()
for user in users:
    print(user.orders)  # Separate query per user

# Good: Eager loading
users = User.query.options(joinedload(User.orders)).all()

Indexing:

CREATE INDEX idx_users_email ON users(email);

API Performance

Cursor-based pagination:

app.get('/api/products', async (req, res) => {
  const { cursor, limit = 20 } = req.query;

  const products = await db.query(
    'SELECT * FROM products WHERE id > ? ORDER BY id LIMIT ?',
    [cursor || 0, limit]
  );

  res.json({
    data: products,
    next_cursor: products[products.length - 1]?.id,
  });
});

Frontend Performance (Core Web Vitals)

Key metrics:

  • LCP (Largest Contentful Paint): < 2.5s
  • INP (Interaction to Next Paint): < 200ms
  • CLS (Cumulative Layout Shift): < 0.1

Optimization techniques:

  • Code splitting (lazy loading)
  • Image optimization (WebP, responsive, lazy loading)
  • Preload critical resources
  • Minimize render-blocking resources

For detailed optimization strategies, see references/optimization-strategies.md and references/frontend-performance.md.

Performance SLOs

Recommended SLOs by Service Type

Service Typep95 Latencyp99 LatencyAvailability
User-Facing API< 200ms< 500ms99.9%
Internal API< 100ms< 300ms99.5%
Database Query< 50ms< 100ms99.99%
Background Job< 5s< 10s99%
Real-time API< 50ms< 100ms99.95%

SLO Selection Process

  1. Measure baseline performance
  2. Identify user expectations
  3. Set achievable targets (10-20% better than baseline)
  4. Iterate as system matures

For detailed SLO framework and performance budgets, see references/slo-framework.md.

CI/CD Integration

Performance Testing in Pipelines

GitHub Actions example:

name: Performance Tests

on:
  pull_request:
    branches: [main]

jobs:
  load-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install k6
        run: |
          curl https://github.com/grafana/k6/releases/download/v0.48.0/k6-v0.48.0-linux-amd64.tar.gz -L | tar xvz
          sudo mv k6-v0.48.0-linux-amd64/k6 /usr/local/bin/

      - name: Run load test
        run: k6 run tests/load/api-test.js

Performance budgets:

// k6 test with thresholds (fail build if violated)
export const options = {
  thresholds: {
    http_req_duration: ['p(95)<500'],
    http_req_failed: ['rate<0.01'],
  },
};

Profiling Workflow

Standard process:

  1. Observe symptoms (high CPU, memory growth, slow response)
  2. Hypothesize bottleneck (CPU? Memory? I/O?)
  3. Choose profiling type based on hypothesis
  4. Run profiler under realistic load
  5. Analyze profile (flamegraph, call tree)
  6. Identify hot spots (top 20% functions using 80% resources)
  7. Optimize bottlenecks
  8. Re-profile to validate improvement

Best practices:

  • Profile under realistic load (not idle systems)
  • Use sampling profilers (py-spy, pprof) in production (low overhead)
  • Focus on hot paths (optimize biggest bottlenecks first)
  • Validate optimizations with before/after comparisons

Tool Recommendations

Load Testing

Primary: k6 (JavaScript-based, Grafana-backed)

  • Modern architecture, cloud-native
  • JavaScript DSL (ES6+)
  • Grafana/Prometheus integration
  • Multi-protocol (HTTP/1.1, HTTP/2, WebSocket, gRPC)

When to use: Modern APIs, microservices, CI/CD integration.

Alternative: Locust (Python-based)

  • Python-native (write tests in Python)
  • Web UI for real-time monitoring
  • Flexible for complex user scenarios

When to use: Python-heavy teams, complex user flows.

Profiling

Python:

  • py-spy (sampling, production-safe)
  • cProfile (deterministic, detailed)
  • memory_profiler (memory leak detection)

Go:

  • pprof (built-in, CPU/heap/goroutine/block profiling)

TypeScript/JavaScript:

  • Chrome DevTools (browser/Node.js)
  • clinic.js (Node.js performance suite)

For detailed tool comparisons, see references/testing-types.md and references/profiling-guide.md.

Reference Documentation

Detailed Guides:

  • references/testing-types.md - Load, stress, soak, spike testing patterns
  • references/profiling-guide.md - CPU, memory, I/O profiling across languages
  • references/optimization-strategies.md - Caching, database, API optimization
  • references/frontend-performance.md - Core Web Vitals, bundle optimization
  • references/slo-framework.md - Setting SLOs, performance budgets
  • references/benchmarking.md - Benchmarking best practices

Examples:

  • examples/k6/ - Load, stress, soak, spike tests
  • examples/locust/ - Python-based load testing
  • examples/profiling/ - Profiling examples (Python, Go, TypeScript)
  • examples/optimization/ - Caching, query, API optimization

Related Skills

For comprehensive testing strategies, see the testing-strategies skill.

For CI/CD integration patterns, see the building-ci-pipelines skill.

For infrastructure sizing based on load tests, see the infrastructure-as-code skill.

For Kubernetes performance testing, see the kubernetes-operations skill.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

25.88%
按下载量换算56

Gemini CLI

25.29%
按下载量换算55

Antigravity

17.67%
按下载量换算39

Claude Code

12.63%
按下载量换算28

roo

7.84%
按下载量换算17

Cursor

3.81%
按下载量换算8

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills