[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"pack-detail-performance-profiling-optimization-fr":3,"seo:pack:performance-profiling-optimization:fr":98},{"code":4,"message":5,"data":6},200,"操作成功",{"pack":7},{"slug":8,"icon":9,"tone":10,"status":11,"status_label":12,"title":13,"description":14,"items":15,"install_cmd":97},"performance-profiling-optimization","⚡","#F59E0B","new","Nouveau · cette semaine","Pack Profilage et Optimisation de Performance","Dix outils pour l'ingénieur face à un endpoint lent, une UI saccadée ou une requête de 8 secondes. Baseline d'abord, puis flamegraph, puis correction d'un hot path, puis tests de régression — avec des agents IA qui lisent les profils au lieu de deviner.",[16,28,36,44,51,58,65,73,83,90],{"id":17,"uuid":18,"slug":19,"title":20,"description":21,"author_name":22,"view_count":23,"vote_count":24,"lang_type":25,"type":26,"type_label":27},4404,"233a6cf7-f333-4014-bd50-9f44e342f6c3","claude-code-agent-performance-profiler-233a6cf7","Claude Code Agent: Performance Profiler","Performance analysis and optimization specialist. Use PROACTIVELY for performance bottlenecks, memory leaks, load testing, optimization strategies, and system performance...","TokRepo精选",24,0,"en","skill","Skill",{"id":29,"uuid":30,"slug":31,"title":32,"description":33,"author_name":34,"view_count":35,"vote_count":24,"lang_type":25,"type":26,"type_label":27},2340,"ac7ff133-4384-11f1-9bc6-00163e2b0d79","lighthouse-automated-web-performance-auditing-google-ac7ff133","Lighthouse — Automated Web Performance Auditing by Google","An open-source tool by Google that audits web pages for performance, accessibility, SEO, and best practices, available in Chrome DevTools, as a CLI, and as a Node module.","Script Depot",180,{"id":37,"uuid":38,"slug":39,"title":40,"description":41,"author_name":42,"view_count":43,"vote_count":24,"lang_type":25,"type":26,"type_label":27},4633,"6a3e54ed-54af-11f1-9bc6-00163e2b0d79","size-limit-performance-budget-tool-javascript-apps-6a3e54ed","Size Limit — Performance Budget Tool for JavaScript Apps","Size Limit calculates the real cost of running your JavaScript in a browser and throws an error if it exceeds the limit. It measures download time and parse\u002Fexecution cost rather than raw bytes, integrating with CI to catch performance regressions in pull requests.","AI Open Source",10,{"id":45,"uuid":46,"slug":47,"title":48,"description":49,"author_name":34,"view_count":50,"vote_count":24,"lang_type":25,"type":26,"type_label":27},2865,"343f06dc-4b7f-11f1-9bc6-00163e2b0d79","flamegraph-stack-trace-visualization-performance-analysis-343f06dc","FlameGraph — Stack Trace Visualization for Performance Analysis","Generate interactive SVG flame graphs from profiling data to pinpoint CPU, memory, and off-CPU bottlenecks across any language or OS.",46,{"id":52,"uuid":53,"slug":54,"title":55,"description":56,"author_name":34,"view_count":57,"vote_count":24,"lang_type":25,"type":26,"type_label":27},2869,"a0541a53-4b7f-11f1-9bc6-00163e2b0d79","async-profiler-low-overhead-sampling-profiler-java-a0541a53","async-profiler — Low-Overhead Sampling Profiler for Java","A low-overhead sampling profiler for JVM applications that captures CPU, allocation, and lock profiles without safepoint bias using perf_events and AsyncGetCallTrace.",47,{"id":59,"uuid":60,"slug":61,"title":62,"description":63,"author_name":34,"view_count":64,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1593,"5abb7410-398f-11f1-9bc6-00163e2b0d79","bcc-ebpf-tracing-performance-analysis-tools-linux-5abb7410","BCC — eBPF Tracing and Performance Analysis Tools for Linux","A toolkit for creating efficient kernel tracing and manipulation programs using eBPF. BCC includes over 100 ready-to-use tools for performance analysis, networking, and security observability on Linux systems.",109,{"id":66,"uuid":67,"slug":68,"title":69,"description":70,"author_name":71,"view_count":72,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1392,"138e4edf-38d7-11f1-9bc6-00163e2b0d79","grafana-pyroscope-continuous-profiling-backend-138e4edf","Grafana Pyroscope — Continuous Profiling Backend","Open-source continuous profiling backend from Grafana Labs that ingests pprof and eBPF profiles, supports label-based queries, and links traces to flamegraphs.","Grafana Labs",130,{"id":74,"uuid":75,"slug":76,"title":77,"description":78,"author_name":79,"view_count":80,"vote_count":24,"lang_type":25,"type":81,"type_label":82},3283,"216cb667-d5ae-5400-99d5-63dd528e1690","postgres-mcp-pro-index-tuning-safe-sql-tools","Postgres MCP Pro — Index Tuning + Safe SQL Tools","Postgres MCP Pro is an MCP server for PostgreSQL that runs safe SQL, explains plans, and recommends indexes so agents can tune databases faster.","MCP Hub",69,"mcp","MCP",{"id":84,"uuid":85,"slug":86,"title":87,"description":88,"author_name":22,"view_count":89,"vote_count":24,"lang_type":25,"type":26,"type_label":27},4288,"7b4df0b3-d4f7-4963-9eed-854781dc65d4","claude-code-agent-graphql-performance-optimizer-7b4df0b3","Claude Code Agent: Graphql Performance Optimizer","GraphQL performance analysis and optimization specialist. Use PROACTIVELY for query performance issues, N+1 problems, caching strategies, and production GraphQL API...",22,{"id":91,"uuid":92,"slug":93,"title":94,"description":95,"author_name":34,"view_count":96,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1116,"4240522f-364b-11f1-9bc6-00163e2b0d79","k6-modern-load-testing-tool-using-go-javascript-4240522f","k6 — Modern Load Testing Tool Using Go and JavaScript","k6 is a modern load testing tool built by Grafana Labs. Write test scripts in JavaScript, run them in a high-performance Go runtime. Developer-centric with CLI-first workflow, CI\u002FCD integration, and Grafana Cloud for result analysis.",182,"tokrepo install pack\u002Fperformance-profiling-optimization",{"pageType":99,"pageKey":8,"locale":25,"title":100,"metaDescription":101,"h1":102,"tldr":103,"bodyMarkdown":104,"faq":105,"schema":121,"internalLinks":126,"citations":139,"wordCount":152,"generatedAt":153},"pack","Performance Profiling + Optimization Pack — 10 Tools to Fix Slow Code, Queries, and UI","Performance Profiler agent, Lighthouse, Size Limit, FlameGraph, async-profiler, BCC, Pyroscope, Postgres MCP Pro, GraphQL Optimizer, k6 — a baseline → profile → diagnose → fix → regression-test loop. Install via TokRepo.","Performance Profiling + Optimization Pack — Stop Guessing, Read the Profile","Ten picks that turn 'this feels slow' into a measured before\u002Fafter. Start with a baseline (Lighthouse, k6, Size Limit), capture a flamegraph (async-profiler, FlameGraph, BCC, Pyroscope), let an AI agent read the profile (Performance Profiler, GraphQL Optimizer, Postgres MCP Pro), fix one hot path, then re-run the baseline. No tool here is speculative; every one earns a step in the loop.","## What's in this pack\n\nThis is the rig for the engineer who just got pinged: *\"the \u002Fsearch endpoint is taking 8 seconds, can you look?\"* — or *\"the dashboard freezes for 2 seconds when I open it.\"* Ten picks, each with a clear role in a five-step loop: **baseline → profile → diagnose → fix → regression-test**.\n\nEvery tool here is **open-source** or has a free tier that covers the loop. No \"contact sales,\" no SaaS-only telemetry. The AI agents (Performance Profiler, GraphQL Performance Optimizer, Postgres MCP Pro) read the *actual profile output* — they don't pattern-match on your code and hallucinate \"add an index here.\"\n\n## Install in this order\n\n1. **Claude Code Agent: Performance Profiler** — the orchestrator. Install first because it's the agent you'll point at flamegraphs and traces. It knows the difference between a CPU profile, an off-CPU profile, and a wall-clock profile, and won't suggest \"add caching\" when the bottleneck is GC pauses.\n2. **Lighthouse** — frontend baseline. Run `lighthouse https:\u002F\u002Fyour.url --output html` before touching anything. Save the report. Every later change gets a re-run for diff. This is your **frontend before-picture**.\n3. **Size Limit** — JS bundle perf budget. Wire it into CI on day one. Once you set `size-limit: [{ path: 'dist\u002F*.js', limit: '200 KB' }]`, every PR that bloats the bundle gets blocked before merge. Cheapest performance win in the stack.\n4. **FlameGraph** — Brendan Gregg's perl\u002FSVG flamegraph generator. The actual file format the rest of the ecosystem speaks. Install once, every other profiler in this pack can pipe into it: `perf script | stackcollapse-perf.pl | flamegraph.pl > out.svg`.\n5. **async-profiler** — low-overhead JVM sampling profiler. For Java\u002FKotlin\u002FScala services. ~1% overhead in production, emits collapsed-stack format that pipes straight into FlameGraph. Captures CPU, allocation, lock contention, and wall-clock in one tool.\n6. **BCC (BPF Compiler Collection)** — eBPF tracing for Linux. Reach for this when the bottleneck is **below your runtime** — syscalls, disk I\u002FO, network, page faults. `biolatency`, `tcpretrans`, `funccount` are the three commands you'll use first.\n7. **Grafana Pyroscope** — continuous profiling backend. Once you've fixed one slow endpoint, install Pyroscope so the *next* regression shows up as a flamegraph diff in a dashboard, not a Slack message at 11pm. Pairs with FlameGraph format natively.\n8. **Postgres MCP Pro** — index tuning + safe SQL MCP. For \"the query is slow\" — point this MCP at your Postgres, ask the agent to explain a query plan, and it returns a real `EXPLAIN ANALYZE` plus index suggestions the agent itself validated by running `EXPLAIN` again. Not a hallucination.\n9. **Claude Code Agent: GraphQL Performance Optimizer** — for the N+1 query problem that every GraphQL gateway eventually hits. Reads your resolvers, finds the unbatched DB calls, suggests DataLoader patterns specific to your schema.\n10. **k6** — JavaScript-scripted load testing. The regression net. After every fix, run the same k6 script against staging and compare p50\u002Fp95\u002Fp99. If you can't reproduce the slowdown with a k6 script, you can't prove the fix.\n\n## How they fit together\n\n```\n┌─ BASELINE ─────────────────────────┐\n│ Lighthouse (frontend)              │\n│ k6 (backend p50\u002Fp95\u002Fp99)           │\n│ Size Limit (bundle budget in CI)   │\n└─────────────┬──────────────────────┘\n              │ \"it's slow — but where?\"\n              ▼\n┌─ PROFILE ──────────────────────────┐\n│ async-profiler (JVM)               │\n│ BCC \u002F eBPF (syscalls, I\u002FO)         │\n│ Pyroscope (continuous, in prod)    │\n│ → all emit FlameGraph format       │\n└─────────────┬──────────────────────┘\n              │ flamegraph.svg\n              ▼\n┌─ DIAGNOSE (agent reads profile) ───┐\n│ Performance Profiler agent         │\n│ Postgres MCP Pro (query plans)     │\n│ GraphQL Performance Optimizer      │\n└─────────────┬──────────────────────┘\n              │ \"hot path is X, fix is Y\"\n              ▼\n        FIX ONE HOT PATH\n              │\n              ▼\n┌─ REGRESSION TEST ──────────────────┐\n│ k6 (rerun same script, diff p95)   │\n│ Lighthouse (rerun, diff scores)    │\n│ Pyroscope (flamegraph diff)        │\n└────────────────────────────────────┘\n```\n\nThe loop is non-negotiable. **Skipping baseline means you can't prove the fix.** Skipping the flamegraph means you're guessing — and the LLM is guessing harder. Skipping regression means the next deploy un-fixes it silently.\n\n## Tradeoffs you'll hit\n\n- **Pyroscope vs ad-hoc async-profiler runs** — Pyroscope is continuous (always-on, low overhead, costs storage). async-profiler is on-demand (run it for 60 seconds when you suspect something, zero idle cost). Start with async-profiler; install Pyroscope only after you've fixed two regressions and want the third to be obvious from a dashboard.\n- **BCC vs `perf`** — BCC is higher-level and writes scripts in Python (readable). `perf` is the kernel's own profiler, lower level, slightly more universal. BCC is the friendlier on-ramp; reach for raw `perf` when you need a specific event source BCC doesn't expose.\n- **Lighthouse local vs LH-CI** — local Lighthouse is one-shot. Lighthouse-CI runs it on every PR and stores the trend. If you're past the first fix, install LH-CI; otherwise local is fine.\n- **Size Limit vs Bundlephobia\u002FWebpack Bundle Analyzer** — Size Limit *blocks* CI on regression (proactive). Analyzers just *show* you the bundle (reactive). Both are useful; Size Limit is the one that prevents the next 50 KB of accidental bloat.\n- **k6 vs Artillery vs Locust** — k6 wins on script ergonomics (real JavaScript, not YAML), built-in p95\u002Fp99 reporting, and Grafana integration. Pick Artillery if your team is YAML-first; pick Locust if your team is Python-first.\n\n## Common pitfalls\n\n- **Profiling in dev, fixing for prod** — your laptop's CPU is faster, the dataset is smaller, and the JVM is in interpreter mode. **Always profile in an environment that mirrors prod load.** Pyroscope-in-prod beats async-profiler-on-laptop every time.\n- **Reading a flamegraph as a call tree** — flamegraphs are *sampled stacks*. Width = CPU time, not call count. A wide block doesn't mean \"called a lot,\" it means \"spent a lot of CPU there.\"\n- **Asking an LLM to optimize without showing it the profile** — every \"optimize this code\" prompt without the actual measurement returns generic advice (\"add memoization,\" \"use a Set\"). Show the agent the flamegraph or the `EXPLAIN ANALYZE`. That's why the Performance Profiler agent and Postgres MCP Pro exist.\n- **Fixing the cold path** — 80% of \"optimizations\" target code that runs 0.1% of the time. Always confirm the function you're rewriting is actually in the top 5 of the flamegraph.\n- **No regression test after the fix** — if you can't replay the slow path with a k6 script (or a SQL repro), you'll re-introduce the regression on the next refactor and not notice for two weeks.",[106,109,112,115,118],{"q":107,"a":108},"I have one slow endpoint right now. Which tool do I start with?","Run k6 against it first to get a number (\"p95 is 8.2s\"). Then capture a flamegraph with async-profiler (JVM) or BCC (anything Linux) for 60 seconds while k6 is hammering it. Hand the flamegraph and the slow query (from your DB logs) to the Performance Profiler agent or Postgres MCP Pro. That's the entire first-fix loop — about 45 minutes if your infra is reachable.",{"q":110,"a":111},"Do I actually need both async-profiler AND Pyroscope?","For the first fix, no. async-profiler alone is enough for an on-demand capture, and the FlameGraph tools render the output. Install Pyroscope when you start fixing the *second* regression and realize you don't want to SSH-in-and-attach every time. Continuous profiling pays off after the third incident.",{"q":113,"a":114},"Why a GraphQL-specific optimizer agent and not just the general Performance Profiler?","GraphQL's N+1 problem is a structural anti-pattern that's hard to see in a flamegraph — the slow part is *many fast queries*, each individually invisible. The GraphQL Performance Optimizer agent reads your resolver code and looks for unbatched DB access patterns directly, suggesting DataLoader fixes scoped to your schema shape. The general profiler will show you \"DB call wide,\" but not \"this resolver fans out 200 calls per request.\"",{"q":116,"a":117},"Can I run BCC on macOS?","No. BCC is eBPF-based and Linux-kernel-only. On macOS, use Instruments (built into Xcode) for native code and async-profiler for JVM. The pack assumes a Linux production target — most servers are Linux even when your laptop isn't.",{"q":119,"a":120},"How big a Size Limit budget should I set on day one?","Measure your current bundle size, round up by 10%, set that as the limit, and ship it. The goal is to block *future* bloat, not to start with a heroic diet. Once CI is green and your team is used to seeing Size Limit comments on PRs, ratchet the limit down 5% every month. Most teams find 30-40% of their bundle is dead weight within a quarter.",{"@context":122,"@type":123,"name":124,"description":125,"numberOfItems":43,"inLanguage":25},"https:\u002F\u002Fschema.org","ItemList","Performance Profiling + Optimization Pack","Ten open-source and AI-agent picks for the baseline → profile → diagnose → fix → regression-test loop on slow code, queries, and UI.",[127,131,135],{"url":128,"anchor":129,"reason":130},"\u002Fen\u002Fai-tools-for\u002Fobservability","Observability tools for AI agents","Profiling and tracing pair naturally with logs\u002Fmetrics from the observability stack",{"url":132,"anchor":133,"reason":134},"\u002Fen\u002Ftopics","Browse other topic packs","Discover packs for backend, frontend, MCP, agents, and more",{"url":136,"anchor":137,"reason":138},"\u002Fen\u002Ffeatured","Featured assets on TokRepo","These ten tools live alongside the broader curated catalog",[140,144,148],{"claim":141,"source_name":142,"source_url":143},"Lighthouse is an open-source automated tool by Google for auditing web pages","Lighthouse official docs","https:\u002F\u002Fdeveloper.chrome.com\u002Fdocs\u002Flighthouse\u002Foverview",{"claim":145,"source_name":146,"source_url":147},"async-profiler is a low-overhead sampling profiler for the JVM","async-profiler GitHub","https:\u002F\u002Fgithub.com\u002Fasync-profiler\u002Fasync-profiler",{"claim":149,"source_name":150,"source_url":151},"k6 is a modern load-testing tool scripted in JavaScript","k6 official site","https:\u002F\u002Fk6.io\u002F",920,"2026-05-22T10:00:00Z"]