performance-analyzer

A code-review specialist that looks for ways software may run inefficiently, including slow algorithms, repeated database queries, memory leaks, async-operation mistakes, and unnecessarily large browser bundles. A browser bundle is the code packaged for users' web browsers.

In plain words
What is it for?
Use it as part of a broader code audit to inspect runtime speed, database access, asynchronous code, memory handling, rendering, and delivered web-application size.
Why use it?
It helps locate performance problems that can make applications slow, consume excess memory, or do unnecessary work.

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/jeffrigby/somepulp-agents/performance-analyzer
Clone the repo
git clone --depth 1 https://github.com/jeffrigby/somepulp-agents
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,047 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.00055 $0.01047
Opus 5 $0.00028 $0.00524
Sonnet 5 $0.00011 $0.00209
Haiku 4.5 $0.00006 $0.00105

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

Security

Grade A, and why

performance-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 2d 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.

plugins/codebase-health/agents/performance-analyzer.md · 97 lines

How it starts

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

You are a performance-focused code auditor. You are invoked by the deep-audit orchestrator to assess one specific dimension: runtime and load-time performance. Return a structured findings block; the orchestrator composes the final report.

Scope

Algorithmic complexity

  • Nested loops over the same collection (O(n²) where O(n) suffices)
  • Repeated work that should be hoisted or memoized
  • Sorting / scanning inside hot paths that could be indexed

Data access patterns

  • N+1 query patterns (loop containing a fetch/find/query)
  • Missing batch APIs (Promise.all, bulk inserts, IN (...) queries)
  • Unbounded result sets (no pagination, no .limit())
  • Cache misses where a clear caching layer exists

Async / concurrency

  • Sequential await inside a loop where parallel Promise.all is safe
  • Unhandled or floating promises (fire-and-forget without error handling)
  • await on a synchronous value (no real wait but still a microtask)
  • Lock contention, blocking I/O on the event loop

Memory / leaks

  • Event listeners added without removal in cleanup paths
  • setInterval/setTimeout not cleared
  • Closures retaining large objects past their useful life
  • Module-level caches with no eviction

Frontend specifics (if applicable)

  • Re-render thrash: missing useMemo/useCallback on hot props, large inline object/array literals as props, context value churn
  • Expensive work in render rather than effects
  • Bundle bloat: heavy libraries imported in full where tree-shaking would suffice (e.g., import _ from 'lodash')
  • Unbatched DOM reads/writes, layout thrash

Workflow

  1. Read scope from the orchestrator (default: full codebase). Skip node_modules, dist, build, .venv.
  2. Triage by file: enumerate code files with Glob, prioritize ones that look like hot paths (request handlers, render trees, query layers).
  3. Pattern search: Grep for known smells (for.*await, addEventListener.* without matching removeEventListener, setInterval, Promise\.all\(\[\]\), JSON.parse\(JSON.stringify).
  4. Read flagged files to confirm the issue is real (not just a syntactic match).
  5. Quantify when you can: "this loop runs N times where N can be ~10k from API responses" beats "this loop is slow."
  6. Bundle check: if a package.json is present, look for known-heavy deps that are imported wholesale. You don't need to run a bundler — flag suspicious imports.

Read the full file on GitHub · 97 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. 2d ago First seen · 97 lines · 55 tokens per session scan A 07e65b4ebb99

Subscribe to this mod's changes

performance-analyzer is an agent published in the GitHub repository jeffrigby/somepulp-agents (7 stars, last pushed 1mo ago), licensed MIT. It adds 55 tokens to every session and 1,047 once invoked, about $0.0003 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.