Agent Skillsjustrach/turboAPI › turbo-benchmark

turbo-benchmark

GitHub

用于运行 TurboAPI 性能基准测试,支持 HTTP、数据库及全场景对比,帮助检测性能回归并与 FastAPI 进行性能比较。

.claude/skills/turbo-benchmark/SKILL.md justrach/turboAPI

触发场景

需要评估 TurboAPI 性能时 检查代码变更导致的性能回归 与 FastAPI 进行基准测试对比

安装

npx skills add justrach/turboAPI --skill turbo-benchmark -g -y
更多选项

非标准路径

npx skills add https://github.com/justrach/turboAPI/tree/main/.claude/skills/turbo-benchmark -g -y

不安装直接使用

npx skills use justrach/turboAPI@turbo-benchmark

指定 Agent (Claude Code)

npx skills add justrach/turboAPI --skill turbo-benchmark -a claude-code -g -y

安装 repo 全部 skill

npx skills add justrach/turboAPI --all -g -y

预览 repo 内 skill

npx skills add justrach/turboAPI --list

SKILL.md

Frontmatter
{
    "name": "turbo-benchmark",
    "description": "Run performance benchmarks for TurboAPI. Use when testing performance, checking for regressions, or comparing against FastAPI.",
    "argument-hint": [
        "http|db|full|all"
    ],
    "disable-model-invocation": true
}

Run TurboAPI Benchmarks

Steps

  1. Determine benchmark type: $ARGUMENTS[0]http (default), db, full, or all
  2. Build turbonet: Run uv run --python 3.14t python zig/build_turbonet.py --install --release
  3. Run the benchmark

HTTP benchmark (TurboAPI vs FastAPI)

uv run --python 3.14t python benchmarks/turboapi_vs_fastapi.py --duration 10 --threads 4 --connections 100

DB benchmark (pg.zig vs SQLAlchemy)

docker run -d --name bench-pg -p 5432:5432 \
  -e POSTGRES_USER=turbo -e POSTGRES_PASSWORD=turbo -e POSTGRES_DB=turbotest \
  postgres:18-alpine
sleep 3
# Seed, then:
uv run --python 3.14t python benchmarks/db_bench_ci.py
docker stop bench-pg && docker rm bench-pg

Full comparison (all query patterns)

# Needs Postgres running on :5432
uv run --python 3.14t python benchmarks/full_comparison.py

Tests: baseline, SELECT by PK, paginated list, full-text search, GROUP BY, and more.

Varying IDs benchmark (cache spread test)

wrk -t2 -c50 -d5s -s benchmarks/varying_ids.lua http://127.0.0.1:8000

Expected numbers (Apple Silicon M3 Pro)

Endpoint TurboAPI FastAPI+SQLAlchemy Speedup
Baseline (no DB) ~133k req/s ~9.8k req/s 14x
SELECT by PK (cached) ~133k req/s ~2.6k req/s 48x
Full-text search ~110k req/s ~2.5k req/s 44x
GROUP BY sum/avg ~129k req/s ~1.4k req/s 96x
Auth + Depends ~116k req/s
Varying IDs (100 keys) ~126k req/s

Regression threshold

CI fails if cached PK drops below 10k req/s. See .github/workflows/db-benchmark.yml.

版本历史

  • 0ef167c 当前 2026-07-25 10:01

同 Skill 集合

.claude/skills/turbo-build/SKILL.md
.claude/skills/turbo-db-route/SKILL.md
.claude/skills/turbo-route/SKILL.md
.claude/skills/turbo-test/SKILL.md
.claude/skills/turbopg/SKILL.md

元信息

文件数
0
版本
1c75a09
Hash
a175134e
收录时间
2026-07-25 10:01

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-02 00:50
浙ICP备14020137号-1 $访客地图$