Make It Faster make-it-faster

Run after any major feature add or milestone to find and land measured improvements in runtime performance, React rendering, Worker/DO overhead, bundle size, and build/check/test speed across the Vibestack stack.

Works in Claude, ChatGPT, Codex and more
Our test
—
not tested yet
GitHub stars
20k
elizaos/eliza
Added by
0
members
Updated
Dec 6
commit e932464
Content
1 file
no scripts · 10 KB
License
MIT
free to use

What our test found

Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.

View on GitHub ↗
name: make-it-faster
description: "Run after any major feature add or milestone to find and land measured improvements in runtime performance, React rendering, Worker/DO overhead, bundle size, and build/check/test speed across the Vibestack stack."

Make it faster

Run this pass after a major feature add, milestone, or performance-sensitive change, once correctness is green. Read in full first, once per session.

Optimization without measurement is guessing. Vet every baseline and speedup with and : name the real limiter before editing, ship only changes that earn their complexity, and prove each win with before/after evidence and green gates.

Phase 0: Gate and baseline

  1. Start from green. Run pnpm verify when defined, otherwise pnpm check, pnpm lint, and pnpm analyze (when present). If pnpm check shows a ✗, follow first.
  2. Choose scope. Skip generated and build directories (gen/, generated/, dist/, .vibe/, .cache/, .spec-cache/, node_modules/).
  3. Feature / PR pass (default): changed files (git diff --name-only <base>...HEAD), their owning spec/ modules, direct callers, hot paths, emitted client chunks, and Turbo tasks they touch.
  4. Full pass (app finish or major milestone): every active package, runtime entrypoint, production bundle, and workspace task.
  5. Measure before editing. Capture reproducible baselines for the affected dimensions (end-to-end latency/throughput, render frame cost, production bundle bytes, pnpm build / pnpm check / pnpm test wall time), write down the threshold that would justify a change, and identify the limiter from a real profile or build artifact per .
  6. If a benchmark will be rerun across edits or PRs, add it as a typed --json script in the owning package's package.json () rather than an ad-hoc script.

Phase 1: Profile and audit the four surfaces

Inspect only surfaces relevant to the scope; on large passes, audit independent surfaces in parallel. Always inspect real runtime profiles, browser traces, dist/ outputs, or Turbo dry-runs instead of guessing from source alone.

1. Runtime and shell (VibeLang, Effect 4, SQLite Durable Objects, Cloudflare Workers)
  • SQLite DO and database queries: eliminate N+1 queries in loops, missing indexes on frequent WHERE / ORDER BY / join columns, unbatched row-by-row writes that belong in one transaction, full-table scans on DO wake, and oversized stored(key) / decodeState blobs rewritten on every tick.
  • Network and RPC waterfalls: parallelize independent try I/O calls with bounded Effect concurrency (Effect.all / Effect.forEach with { concurrency }), batch chatty Worker ↔ DO or API round-trips, and stream large payloads instead of buffering them in memory.
  • Boundary serialization and hot-path allocations: parse and decode untrusted data once at system boundaries (); remove redundant JSON.parse/JSON.stringify, structuredClone, or re-decoding on trusted internal paths; hoist Intl.*, RegExp, and parser/formatter instantiation out of hot loops.
  • Machine churn and persistence writes: cut redundant Machine.send dispatches (no-op events, duplicate submits, polling loops) that trigger needless keep / stored writes or wake changes subscribers.
  • Memory, leaks, and Worker cold starts: bound every in-memory Map/Set/cache with explicit eviction and invalidation; revoke blob: URLs; pair Stream.callback / FiberMap resources with addFinalizer / acquireRelease; strip eager top-level work or heavy imports from Worker entrypoints to protect isolate cold-start and CPU budgets; ensure Alchemy CLI invocations set ALCHEMY_FAST_DISTILLED=1 ().
2. React rendering and UI responsiveness

Respect : never add useEffect or setTimeout workarounds, and never duplicate spec-owned state outside Machine ().

  • Selective `Machine` subscriptions: replace broad useMachine(runtime) calls on hot or wide subtrees with useMachine(runtime, select, equals?) or useMachineSelector(runtime, select, equals?) from gen/<name>.react.ts, and avoid subscribing one component to many whole machines.
  • Render work and reference stability: move expensive sorting, filtering, or formatting off repeated render paths; stabilize object, array, and callback references passed into heavy subtrees; keep high-frequency transient UI drafts (typing, pointer drag, open menus) in local useState until committed instead of dispatching Machine events at 60Hz.
  • Lists, layout, and paint: virtualize or paginate large lists/tables; eliminate interleaved DOM reads and writes causing forced synchronous reflow; fix unstable key props that remount subtrees; animate compositor-only properties (transform, opacity) while honoring prefers-reduced-motion; set explicit media dimensions to prevent layout shift, lazy-load offscreen media (loading="lazy"), and subset/preload critical fonts.
3. Bundle size and delivery (Vite, Tailwind v4, Workers Static Assets)
  • Inspect real build output: run pnpm build and measure emitted dist/ chunks (raw and compressed) and their largest modules.
  • Shrink the initial client chunk: remove accidental server/Node modules, broad Effect/platform imports, or heavy chart/editor/utility libraries from the initial entry; code-split heavy or rare routes and panels behind dynamic import() with a non-blank fallback.
  • Tree-shaking and dependencies: keep workspace root barrels ("." in exports) required by , while flagging impure module top-levels blocking tree-shaking ("sideEffects": false where pure), eager re-exports of optional heavy features inside app files, and duplicate dependency versions in pnpm-lock.yaml.
  • Assets, CSS, and edge delivery: trim unused font weights/subsets and oversized SVGs/images; keep CSS confined to design tokens and Tailwind v4 utilities; verify Cloudflare deploys use the single-build handoff (bundle: false + hashAssetDirectory in ) so unchanged assets are neither double-built nor re-uploaded.
4. Build, check, and test speed (Turborepo, Vite, VibeLang, Vitest, pnpm check)

Per , a small edit must rerun only what it touches, and a full run should stay as fast as possible.

  • Turborepo graph and caching (`turbo.json`): check pnpm exec turbo run <task> --dry=json for overly broad inputs (tests, docs, .DS_Store, .alchemy/, .wrangler/, .spec-cache/, generated files) poisoning build or gen caches, missing outputs, needless task edges serializing parallel work, or volatile env vars leaking into cache keys instead of passThroughEnv on uncached tasks.
  • Typecheck, Vite, and lint latency: keep deploy/ and alchemy.run.ts isolated in deploy/tsconfig.json and ESLint's untyped list () so pnpm lint:js stays fast and never OOMs; tighten wide tsconfig.json scopes and eliminate redundant build steps.
  • Test and check loop: consolidate Vitest journeys repeating heavy database/server/DOM setup instead of sharing helpers or extending existing journeys (); avoid Chromium (pnpm test:browser) for behavior already proved by the spec or covered in Node; preserve .spec-cache/ and Vitest receipts rather than bypassing them; tune sluggish Quint simulation (weight_ or wide <param>Values) only without weakening any rule ().

Phase 2: Triage and apply in verifiable units

Rank opportunities by measured end-to-end impact against added complexity:

| Priority | Act on | |---|---| | High | User-visible latency or jank, Worker CPU/memory/cold-start bottlenecks, bloated initial client chunks, broken Turbo or pnpm check cache invalidation | | Medium | Hot-path allocations or redundant serialization, chatty internal RPCs, secondary chunk splits, duplicated heavy test setup | | Skip | Cold-path micro-optimizations, gains inside the measurement noise floor, or caches whose invalidation complexity outweighs a small win () |

Apply one optimization hypothesis per unit () so each measurement isolates what moved the number.

Never trade away correctness or stack rules: never edit gen/, .spec-cache/, .studio/, or spec/lock.json; never weaken a spec rule, proof, or test; never add useEffect, setTimeout, code comments, a second state library, or new Markdown reports; never break root barrel exports.

Phase 3: Re-measure and verify gates

  1. Prove every win. Re-run the baseline comparison under . Revert any change whose effect is within run-to-run variation, fails to move the end-to-end metric, or does not earn its complexity.
  2. Confirm every relevant gate is green:
  3. pnpm check (follow if any spec changed),
  4. pnpm lint and pnpm analyze (when defined),
  5. pnpm test:browser plus a quick check in the running build for UI/rendering changes,
  6. pnpm test:deploy when Workers, Durable Objects, static assets, or alchemy.run.ts changed.

Report

Summarize concisely when done:

  1. Scope and baselines: surfaces audited, baseline numbers, named limiters, and gate status.
  2. Verified wins: each change with file:line, metric, before → after (median, range, run count), and limiter moved.
  3. Reverted or skipped: measured no-ops or ideas rejected for complexity.
  4. Remaining bottlenecks: structural limiters or tradeoffs needing user input, or state explicitly that none remain.