performance-investigation

作成者: sveltejs

パフォーマンスの低下を調査し、最適化の機会を見つける

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のその他のスキル

svelte-code-writer
sveltejs
Svelte 5のドキュメント検索とコード分析のためのCLIツールで、内蔵の自動修正機能を備えています。3つの主要コマンドがあります:利用可能なドキュメントを閲覧するlist-sections、特定のトピックの完全なドキュメントを取得するget-documentation、コードを分析して修正を提案するsvelte-autofixer。Autofixerは--svelte-versionフラグでSvelte 4と5のターゲット指定、--asyncオプションで非同期モードに対応。インラインコード(エスケープされた$文字を含む)とファイルパスの両方を受け入れ、分析に使用します。
official
svelte-core-bestpractices
sveltejs
高速で堅牢かつモダンな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
ユーザーの説明に基づいて作成する新しいシナリオを選び、その執筆をai-scenario-writerサブエージェントに委任し、正確性を検証します。
official
performance-investigation
sveltejs
パフォーマンス低下を調査し、最適化の機会を見つける
official
writing-opencode-plugins
sveltejs
OpenCodeプラグイン、@opencode-ai/plugin、@opencode-ai/plugin/tui、プラグインフック、カスタムツール、TUIルート、スロット、キーマップ、およびパッケージング。作成時に使用…
official
scenario-writer
sveltejs
ユーザーの説明に基づいて新しいシナリオを選定し、その執筆をai-scenario-writerサブエージェントに委任し、正確性を検証します。
official