performance-investigation

Leistungsregressionen untersuchen und Optimierungsmöglichkeiten finden

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.

Mehr Skills von sveltejs

performance-investigation
sveltejs
Untersuchen Sie Leistungsrückgänge und finden Sie Optimierungsmöglichkeiten
official
svelte-code-writer
sveltejs
We need to translate the given English text into German, preserving the name "svelte-code-writer" if it appears, but it does not appear in the source text. The source text describes CLI tools for Svelte 5 documentation lookup and code analysis with autofixer. We must not add any extra commentary, labels, or formatting. Just the translation. Let's translate: "CLI tools for Svelte 5 documentation lookup and code analysis with built-in autofixer." -> "CLI-Tools für die Svelte 5 Dokumentationssuche und Code-Analyse mit integriertem Autofixer." "Three core commands: list-sections to browse available docs, get-documentation to fetch full documentation for specific topics, and svelte-autofixer to analyze code and suggest fixes" -> "Drei Kernbefehle: list-sections zum Durchsuchen verfügbarer Dokumente, get-documentation zum Abrufen der vollständigen Dokumentation für bestimmte Themen und svelte-autofixer zum
official
svelte-core-bestpractices
sveltejs
Anleitung zum Schreiben von schnellem, robustem, modernem Svelte-Code. Lade diese Fähigkeit, wenn du in einem Svelte-Projekt bist und gebeten wirst, eine Svelte-Komponente zu schreiben, zu bearbeiten oder zu analysieren oder…
official
svelte-code-writer
sveltejs
CLI-Tools für Svelte 5 Dokumentationssuche und Code-Analyse. MÜSSEN verwendet werden, wann immer Svelte-Komponenten (.svelte) erstellt, bearbeitet oder analysiert werden oder 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
Wählt basierend auf der Beschreibung des Benutzers ein neues Szenario zur Erstellung aus, delegiert das Schreiben an den ai-scenario-writer-Subagenten und überprüft die Korrektheit.
official
writing-opencode-plugins
sveltejs
OpenCode-Plugins, @opencode-ai/plugin, @opencode-ai/plugin/tui, Plugin-Hooks, benutzerdefinierte Tools, TUI-Routen, Slots, Keymaps und Paketierung. Verwenden beim Erstellen,…
official
scenario-writer
sveltejs
Wählt ein neues Szenario basierend auf der Beschreibung des Benutzers aus, delegiert das Schreiben an den ai-scenario-writer-Subagenten und überprüft die Korrektheit.
official