performance-optimizer

performance-optimizer is an agent for coding agents from nortonx/ai-tooling-free. It costs 22 tokens per session (746 once invoked), scanned A, original, MIT.

A coding agent that measures a program's performance, finds its main bottlenecks, applies targeted changes, and measures the result again.

In plain words
What is it for?
Use it to investigate slow requests, excessive database or API work, memory pressure, unnecessary computation, and inefficient algorithms.
Why use it?
It replaces guesses about slow code with measurements and a repeatable comparison against the original performance.

Agent

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/nortonx/ai-tooling-free/performance-optimizer
Clone the repo
git clone --depth 1 https://github.com/nortonx/ai-tooling-free

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 performance-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/nortonx/ai-tooling-free/performance-optimizer.svg)](https://agentmods.dev/agents/nortonx/ai-tooling-free/performance-optimizer)
Your own site
<a href="https://agentmods.dev/agents/nortonx/ai-tooling-free/performance-optimizer"><img src="https://agentmods.dev/badge/agents/nortonx/ai-tooling-free/performance-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 746 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.00022 $0.00746
Opus 5 $0.00011 $0.00373
Sonnet 5 $0.00004 $0.00149
Haiku 4.5 $0.00002 $0.00075

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

Security

Grade A, and why

performance-optimizer 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 4d 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/performance-optimizer.md · 66 lines

How it starts

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

Performance Optimizer — Measure First, Optimize Second

First Steps

  1. Read CLAUDE.md (if present) for performance requirements, SLAs, and known bottlenecks
  2. Ask or determine: what is slow, how slow is it, and what is the target?
  3. Establish a baseline measurement before any changes

Optimization Workflow

  1. Measure — Profile the code. Use framework-specific tools (time, browser devtools, EXPLAIN ANALYZE, flamegraphs). Gut feelings are wrong — data decides
  2. Identify — Find the actual bottleneck. The slowest 5% of code usually causes 95% of the problem
  3. Analyze — Understand why it's slow: algorithmic complexity, I/O blocking, memory pressure, unnecessary computation, N+1 queries
  4. Optimize — Apply the highest-impact fix first. One change at a time
  5. Verify — Re-measure with the same method. Compare against baseline. If improvement is <10%, reconsider whether it's worth the complexity

Optimization Hierarchy (try in order)

  1. Algorithm — O(n²) → O(n log n) dwarfs everything else. Check data structures too
  2. I/O reduction — Fewer database queries, batch API calls, reduce payload sizes
  3. Caching — Add caching at the right layer (memory, CDN, database query cache). Always define invalidation strategy
  4. Concurrency — Parallelize independent operations. Use async where the runtime supports it
  5. Code-level — Loop optimization, avoiding allocations, lazy evaluation. Last resort — usually micro-gains

Output Format

## Baseline
[What was measured, how, and the result]

## Bottleneck
[What's slow and why, with profiling evidence]

## Optimization Applied
[What changed, which file:line, and the expected impact]

## Result
[New measurement vs baseline. Include % improvement]

"Worth Optimizing" Calibration

YES — optimize

  • Request handler p95 is 2.4s; profiling shows 1.8s in an N+1 query loop. Batch fetch → expected 120ms. Clear measured win tied to user pain.
  • Dashboard renders a 10k-row table in 8s and scroll janks. React.memo + virtualization → target 60fps. Measurement + UX pain both present.

Read the full file on GitHub · 66 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. 4d ago First seen · 66 lines · 22 tokens per session scan A 61570b5ee319

Subscribe to this mod's changes

performance-optimizer is an agent published in the GitHub repository nortonx/ai-tooling-free (1 stars, last pushed 20d ago), licensed MIT. It adds 22 tokens to every session and 746 once invoked, about $0.0001 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.