performance-investigation

द्वारा sveltejs

Investigate performance regressions and find opportunities for optimization

npx skills add https://github.com/sveltejs/svelte --skill performance-investigation

Quick start

  1. Start from a branch you want to measure (for example foo).
  2. Run:
pnpm bench:compare main foo

If you pass one branch, bench:compare automatically compares it to main.

Where outputs go

  • Summary report: benchmarking/compare/.results/report.txt
  • Raw benchmark numbers:
    • benchmarking/compare/.results/main.json
    • benchmarking/compare/.results/<your-branch>.json
  • CPU profiles (per benchmark, per branch):
    • benchmarking/compare/.profiles/main/*.cpuprofile
    • benchmarking/compare/.profiles/main/*.md
    • benchmarking/compare/.profiles/<your-branch>/*.cpuprofile
    • benchmarking/compare/.profiles/<your-branch>/*.md

The .md files are generated summaries of the CPU profile and are usually the fastest way to inspect hotspots.

Suggested investigation flow

  1. Open benchmarking/compare/.results/report.txt and identify largest regressions first.
  2. For each high-delta benchmark, compare:
    • benchmarking/compare/.profiles/main/<benchmark>.md
    • benchmarking/compare/.profiles/<branch>/<benchmark>.md
  3. Look for changes in self/inclusive hotspot share in runtime internals (runtime.js, reactivity/batch.js, reactivity/deriveds.js, reactivity/sources.js).
  4. Make one optimization change at a time, then re-run targeted benches before re-running full compare.

Fast benchmark loops

Run only selected reactivity benchmarks by substring:

pnpm bench kairo_mux kairo_deep kairo_broad kairo_triangle
pnpm bench repeated_deps sbench_create_signals mol_owned

Tests to run after perf changes

Runtime reactivity regressions are most likely in runes runtime tests:

pnpm test runtime-runes

Helpful script

For quick cpuprofile hotspot deltas between two branches:

node benchmarking/compare/profile-diff.mjs kairo_mux_owned main foo

This prints top function sample-share deltas for the selected benchmark.

Practical gotchas

  • bench:compare checks out branches while running. Avoid uncommitted changes (or stash them) so branch switching is safe.
  • Each bench:compare run rewrites benchmarking/compare/.results and benchmarking/compare/.profiles.

sveltejs की और Skills

performance-investigation
sveltejs
प्रदर्शन में गिरावट की जांच करें और अनुकूलन के अवसर खोजें
official
svelte-code-writer
sveltejs
Svelte 5 दस्तावेज़ीकरण खोज और कोड विश्लेषण के लिए CLI उपकरण, जिसमें अंतर्निहित ऑटोफिक्सर शामिल है। तीन मुख्य कमांड: उपलब्ध दस्तावेज़ ब्राउज़ करने के लिए list-sections, विशिष्ट विषयों के लिए पूर्ण दस्तावेज़ प्राप्त करने के लिए get-documentation, और कोड का विश्लेषण करने और सुझाव देने के लिए svelte-autofixer। ऑटोफिक्सर --svelte-version फ़्लैग के माध्यम से Svelte 4 और 5 को लक्षित करने और --async विकल्प के माध्यम से एसिंक मोड का समर्थन करता है।
official
svelte-core-bestpractices
sveltejs
तेज़, मजबूत और आधुनिक Svelte कोड लिखने के लिए मार्गदर्शन। जब भी किसी Svelte प्रोजेक्ट में हों और किसी Svelte कम्पोनेंट को लिखने/संपादित करने या विश्लेषण करने के लिए कहा जाए, तो इस कौशल को लोड करें…
official
svelte-code-writer
sveltejs
Svelte 5 दस्तावेज़ खोज और कोड विश्लेषण के लिए CLI टूल्स। किसी भी Svelte घटक (.svelte) या Svelte… बनाते, संपादित करते या विश्लेषण करते समय इसका उपयोग अनिवार्य है।
official
svelte-core-bestpractices
sveltejs
Guidance on writing fast, robust, modern Svelte code. Load this skill whenever in a Svelte project and asked to write/edit or analyze a Svelte component or…
official
scenario-writer
sveltejs
Picks a new scenario to create based on the description of the user, delegates the writing of it to the ai-scenario-writer subagent and verify the correctness.
official
writing-opencode-plugins
sveltejs
OpenCode प्लगइन्स, @opencode-ai/plugin, @opencode-ai/plugin/tui, प्लगइन हुक, कस्टम टूल्स, TUI रूट्स, स्लॉट्स, कीमैप्स, और पैकेजिंग। उपयोग करें जब बनाते, …
official
scenario-writer
sveltejs
उपयोगकर्ता के विवरण के आधार पर बनाने के लिए एक नया परिदृश्य चुनता है, उसके लेखन को ai-scenario-writer उप-एजेंट को सौंपता है और शुद्धता की पुष्टि करता है।
official