Index of every page on this site: llms.txt
All skills
Run it yourself

Micro-benchmark and iteratively improve hot paths in any codebase: baseline first, mandatory improvement suggestions (bottleneck + 3 creative ideas + recommended next step), bounded attempts, user lock-in checkpoints, then human WHY comments after lock-in. Use when the user asks to benchmark, profile, optimize performance, compare implementations, or measure µs/op before shipping perf changes. Applies to Bun/Node, React, Next.js, browser code, and extensions.

Use this Skill: https://skilld.dev/gh/illyism/dev-skills/benchmarking

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

devtools.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Chrome DevTools — live perf for extensions

Use this when the benchmarking skill routes you to manual trace (picker hover, full action E2E, cold start). Report ms, not µs/op.

Local harness first: SKILL.md. When to trace vs bench: perf-live-traces.md.


Before you record

Do Don't
Reload the extension after code changes (chrome://extensions or dev watcher) Record during the first second after opening Performance (profiler startup spike)
Pick one action per trace (hover-only or copy-only or both — label it) Mix many unrelated actions in one recording
Note URL, extracted element (tag + rough size), export format (JSX / Tailwind / CSS) Trust absolute ms across machines as ship gates
CPU: No throttling unless reproducing mobile Use Lighthouse for picker/content-script hot paths

Profiler noise: The first long frame after Record often includes CpuProfiler::StartProfiling (hundreds of ms). Start moving the picker after recording begins, or trim that frame when reading the trace.


Record an extension trace (Chrome MV3)

  1. Open the target tab (real site — Vercel, docs, etc.).
  2. Open DevTools → Performance (not Lighthouse).
  3. Click Record (circle) — do not reload unless measuring cold inject.
  4. Enable the extension's picker (extension popup or shortcut).
  5. Perform the labeled action:
    • Hover: move across 3–5 elements for ~3s; do not click.
    • Copy: one click or Enter on a single element.
    • Both: hover ~2s, then one copy — say so in notes.
  6. Stop recording.
  7. In the flame chart, select the longest Main task during your action (ignore the first profiler frame).

Export for agent review

  • Save profile: Performance panel → down-arrow → Save profile → Trace-YYYYMMDDTHHMMSS.json
  • Attach the JSON in chat, or paste a screenshot of Bottom-up / Call tree filtered to content.bundle

Read the trace

Find your extension's work

Filter or search the call tree for:

Function (example names) Path Means
onMouseMove handler content script Hover / selection (should be sub-ms per call × N moves)
updateOverlay content script Outline / toolbar repaint
handleClick content script User action started
serialize / transform export Pure computation on the click path
color / style conversion export Heavy on CSS-variable-rich sites

Swap in your own function names; the point is to tag each hot function with the layer it belongs to.

Your extension's user-timing marks may appear as a user-timing bucket in Bottom-up — child calls still map to content.bundle.js.

Separate hover vs copy

Symptom Likely layer Next step
Lag while moving mouse, outline stuck or jumpy Hover handler / overlay updates Fix the content script; do not tune the export benchmark
Fine hover, pause on click Export / mapper / clipboard Run the export benchmark suite; check for storage reads or caches on the click path
Long frame before click, fast copy Hover frame dominated pre-click Same as row 1
~500ms once at trace start DevTools profiler Ignore; re-record or trim

Quick JSON sanity (optional)

From repo root, on a saved trace:

bun -e "
const ev = JSON.parse(require('fs').readFileSync('PATH/Trace.json','utf8')).traceEvents;
const hits = ev.filter(e => e.ph==='X' && e.dur>500 && e.args?.data?.url?.includes?.('content.bundle'));
const m = new Map();
for (const e of hits) { const k = e.args?.data?.functionName||'?'; m.set(k,(m.get(k)||0)+e.dur); }
console.log([...m.entries()].sort((a,b)=>b[1]-a[1]).slice(0,10).map(([k,v])=>[k,(v/1000).toFixed(1)+'ms']));
"

Extension-specific surfaces (manual-only)

Typical surfaces for a picker-style extension (keep your own list in tools/benchmark-domains.md):

Surface What to measure
Picker first paint Time from enable inspection → outline visible
Hover Mouse-move handler aggregate ms over 3s
Copy E2E Click → clipboard → “Copied” feedback
Extension cold start Popup open, content script inject (separate traces)

Happy-dom benchmarks cover export/mapper only — not outline paint or elementFromPoint on real DOM.


After the trace

  1. Append a row to perf-live-traces.md (date, URL, action, dominant ms, conclusion).
  2. If shipping a fix: local Round 0 → change → optional confirm trace → outcome entry (template) + perf-rules.md.
  3. Live traces confirm feel; ship gate for code changes stays on local bench + tests unless the bug is paint/input-only (no suite).

When to use something else

Goal Use
LCP, INP, CLS, whole page load web-perf skill
React component render churn React Profiler
Function µs/op on fixtures bun run benchmark — not DevTools

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides a legitimate and structured micro-benchmarking workflow with helper scripts for timing functions and running benchmark suites. No malicious patterns or security risks were detected.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at f8a2249. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 weeks ago
Other metadata
metadata
{
  "version": "1.0.0",
  "author": "illyism",
  "source": "https://il.ly/skills/benchmarking"
}

README badge

README badge for illyism/dev-skills/benchmarking