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.

perf-rules.md

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

Perf rules (portable lint policy)

Short rules agents and reviewers apply on hot paths. No golden µs — only patterns. Update after each outcome log (template) lock-in when a learning generalizes.

I/O and extension APIs

Rule Rationale
P-01 Don't read chrome.storage (or async settings) on every user action in a session Preload at session start; listen to onChanged for invalidation
P-02 Defer analytics, persistence, and library writes until after the user-visible outcome Clipboard / download / toast first

DOM and export walks

Rule Rationale
P-03 Scope memo caches to one export or picker session; clear on endSession Avoid stale styles; bound memory
P-04 Memoize repeated pure transforms (color parse → utility, normalized keys) inside that scope Same computed string hits dozens of nodes on dashboards
P-05 Skip redundant work on high-frequency events (hover): early exit when target unchanged RAF-coalesce + contains-check before re-selection
P-10 Skip page shell on small extracted elements; don’t inject body font/color on phrasing roots Paste targets already set globals; small divs skip min-h-screen wrapper
P-11 Hover skip: never block child drill-down inside a highlighted ancestor contains(rawElement) made picker feel stuck/laggy on real pages

Measurement

Rule Rationale
P-06 Round 0 baseline before editing production code Compare all attempts vs shipped, not vs last attempt
P-07 Local bench for export/mapper; live trace for picker E2E and real-site CSS Don't optimize hover from export-benchmark numbers alone
P-08 Log lock-ins to outcome log (template) with date, suites, and portable learnings Builds org memory; numbers stay in the log file only

Next.js Cache Components + auth

Rule Rationale
P-12 Don't call getSession / headers() at the page root under Cache Components Uncached request data blocks prerender; wrap auth + page fetch in <Suspense> so the shell can stream
P-13 await connection() before Better Auth getSession when cookieCache is on Cookie-cache expiry uses Date.now(); without a request-time mark, layouts throw blocking-prerender-current-time
P-14 Don't put slow SQL or full-export payloads in the initial RSC document; fetch below-the-fold on view Suspense still keeps HTML open until the slowest island; competing POSTs delay above-the-fold charts
P-15 Directory homepages: first HTML is above-the-fold only; load the card grid after intersection (or filter URL) Suspense still serializes the listing into the document; observer + client fetch keeps screenshot URLs out of first paint

Remotion / headless stills

Rule Rationale
P-16 Don't call renderStill per live still request It opens a tab, loads the webpack bundle, screenshots, and closes — that dwarfs React caption layout
P-17 Pass cacheable HTTPS template URLs into the player, not data URLs Same format, new captions should hit Chrome's HTTP cache instead of re-decoding a giant base64 string

Comments in src/

Rule Rationale
P-09 WHY comments only after lock-in; no µs/op in code See benchmarking skill Step 7

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