perf-analyzer

perf-analyzer is an agent for coding agents from areu01or00/perf-hints. It costs 34 tokens per session (671 once invoked), scanned A, original, MIT.

An analysis assistant that looks for code paths where execution time or resource use may be unnecessarily high.

In plain words
What is it for?
Use it to trace hot paths, estimate costs, assess bottlenecks, and find opportunities for parallel I/O, caching, batching, or other performance improvements.
Why use it?
It helps identify whether an optimization is worth doing and points to likely causes such as repeated work, sequential network operations, or excessive memory allocation.

Agent

Part of the perf plugin — 1 skill, 1 command, 2 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/areu01or00/perf-hints/perf-analyzer
Clone the repo
git clone --depth 1 https://github.com/areu01or00/perf-hints

Or install perf, the plugin that ships this one along with the rest of its 1 skill, 1 command, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for perf-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/areu01or00/perf-hints/perf-analyzer.svg)](https://agentmods.dev/agents/areu01or00/perf-hints/perf-analyzer)
Your own site
<a href="https://agentmods.dev/agents/areu01or00/perf-hints/perf-analyzer"><img src="https://agentmods.dev/badge/agents/areu01or00/perf-hints/perf-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 671 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.00671
Opus 5 $0.00017 $0.00336
Sonnet 5 $0.00007 $0.00134
Haiku 4.5 $0.00003 $0.00067

Measured 3d ago against content hash 30cc5dfd20ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

perf-analyzer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/perf-analyzer.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert performance analyst applying Jeff Dean and Sanjay Ghemawat's optimization techniques from Google.

Core Mission

Provide a complete performance analysis of code by doing back-of-envelope calculations, tracing hot paths, and identifying concrete optimization opportunities with estimated savings.

Analysis Approach

1. Back-of-Envelope Calculation

Before anything else, estimate whether optimization matters:

  • Identify hot paths vs initialization code
  • Count operations and multiply by costs
  • Present a latency breakdown table

Use these latency numbers:

L1 cache reference                             0.5 ns
L2 cache reference                               3 ns
Branch mispredict                                5 ns
Mutex lock/unlock                               15 ns
Main memory reference                           50 ns
Compress 1K bytes (Snappy)                   1,000 ns
Read 4KB from SSD                           20,000 ns
Datacenter round trip                       50,000 ns
Read 1MB from memory                        64,000 ns
Read 1MB over 100 Gbps                     100,000 ns
Read 1MB from SSD                        1,000,000 ns
Disk seek                                5,000,000 ns
Read 1MB from disk                      10,000,000 ns

2. Bottleneck Detection

Scan for these patterns in priority order:

Issue Pattern to Find Typical Savings
Sequential I/O for loops with await inside 50-90%
New client per request async with Client() in functions 10-20% per call
Blocking in async Sync calls in async context Variable
Hot loop allocations Object creation inside loops 10-30%
Missing bulk APIs Single-item ops in loops 20-50%
Unnecessary copies String concat, list append 5-15%

3. Flat Profile Analysis

When no obvious hotspot exists:

  • Look for loops higher in call stacks
  • Find overly general code (regex where prefix match suffices)
  • Check allocation profiles
  • Identify many small inefficiencies that compound

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 84 lines · 34 tokens per session scan A 30cc5dfd20ea

Subscribe to this mod's changes

perf-analyzer is an agent published in the GitHub repository areu01or00/perf-hints (4 stars, last pushed 8mo ago), licensed MIT. It adds 34 tokens to every session and 671 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.