بنقرة واحدة
profile
// Profile a benchmark workload with dotTrace sampling, generate an XML report, and analyze hot spots
// Profile a benchmark workload with dotTrace sampling, generate an XML report, and analyze hot spots
Start / stop / status of the Typhon Workbench dev servers (Kestrel :5200 + Vite :5173) with file-based PID tracking so state survives across Claude Code sessions
Implement a GitHub issue end-to-end — scope it (whole issue or specific phases), build an acceptance-criteria plan from its design doc, get the plan approved, then develop autonomously with tests and a mandatory code review.
Complete work on a GitHub issue - close issue, update artifacts, prompt for doc updates
Create a GitHub issue and add it to the Typhon dev project
Scaffold a new Workbench panel — full stack (server DTOs/service/controller/tests + client hooks/store/panel/context-menu/tests + wiring + Playwright canary) that compiles on first invocation
Start working on a GitHub issue - updates status, creates branch, verifies design
| name | profile |
| description | Profile a benchmark workload with dotTrace sampling, generate an XML report, and analyze hot spots |
| argument-hint | <target> [--compare <baseline.xml>] [--filter <pattern>] [--callers <method>] [--top N] |
Profile a Typhon benchmark workload using JetBrains dotTrace (sampling mode), export results via Reporter, and analyze with the Python script.
These tools must be installed (one-time setup):
dotnet tool install --global JetBrains.dotTrace.GlobalToolsdotnet add package JetBrains.dotTrace.CommandLineTools.windows-x64 (for Reporter.exe)Both are already installed in this project.
DOTTRACE = dottrace (global tool, requires DOTNET_ROLL_FORWARD=LatestMajor on .NET 10+)
REPORTER = $USERPROFILE/.nuget/packages/jetbrains.dottrace.commandlinetools.windows-x64/2025.3.2/tools/Reporter.exe
ANALYZER = test/Typhon.Benchmark/profiling/analyze_profile.py
PROFILE_DIR = test/Typhon.Benchmark/profiling
If REPORTER path doesn't exist, look for the latest version:
ls "$USERPROFILE/.nuget/packages/jetbrains.dottrace.commandlinetools.windows-x64/"
$ARGUMENTS may contain:
<target> (required) — The benchmark target to profile. Can be:
--profile-delete (BTreeDeleteProfile)--filter *BTreeMicro*--compare <baseline.xml> — Compare current results against a baseline profile XML--filter <pattern> — Regex pattern to filter the analysis output (e.g., Remove, BTree)--callers <method> — Show callers of a specific method--top N — Number of top functions to show (default: 15)--save-as <name> — Save the snapshot/report with a descriptive name (default: btree-profile)cd test/Typhon.Benchmark && dotnet build -c Release
If build fails, report errors and stop.
Determine the profiling command based on <target>:
For --profile-delete or other custom flags:
cd test/Typhon.Benchmark && DOTNET_ROLL_FORWARD=LatestMajor dottrace start \
--profiling-type=Sampling \
--save-to=profiling/<name>.dtp \
--overwrite \
--propagate-exit-code \
-- bin/Release/net10.0/Typhon.Benchmark.exe <target-args>
For BDN --filter targets:
cd test/Typhon.Benchmark && DOTNET_ROLL_FORWARD=LatestMajor dottrace start \
--profiling-type=Sampling \
--save-to=profiling/<name>.dtp \
--overwrite \
--propagate-exit-code \
-- bin/Release/net10.0/Typhon.Benchmark.exe --filter '<filter>'
IMPORTANT: Always profile the built executable directly (bin/Release/net10.0/Typhon.Benchmark.exe), NOT via dotnet run. Using dotnet run adds MSBuild noise to the profile.
IMPORTANT: Always use DOTNET_ROLL_FORWARD=LatestMajor — the dotTrace tool targets .NET 8 but we run .NET 10+.
Use the pattern file to extract Typhon-only functions:
"$USERPROFILE/.nuget/packages/jetbrains.dottrace.commandlinetools.windows-x64/2025.3.2/tools/Reporter.exe" \
report "profiling/<name>.dtp" \
--pattern="profiling/btree-pattern.xml" \
--save-to="profiling/<name>-report.xml" \
--overwrite \
--save-signature
The default pattern file (profiling/btree-pattern.xml) captures all Typhon\. methods. For other workloads, create a specific pattern file:
<Patterns>
<Pattern PrintCallstacks="Full">Typhon\.</Pattern>
</Patterns>
Default analysis (full report):
cd test/Typhon.Benchmark && python profiling/analyze_profile.py profiling/<name>-report.xml
With filter:
python profiling/analyze_profile.py profiling/<name>-report.xml --filter "Remove" --top 20
Callers analysis:
python profiling/analyze_profile.py profiling/<name>-report.xml --callers "GetChunk"
JSON output (for programmatic use):
python profiling/analyze_profile.py profiling/<name>-report.xml --json
--compare was specified)If a baseline XML was provided, run the comparison:
python profiling/analyze_profile.py profiling/<baseline>.xml --compare profiling/<name>-report.xml
This shows per-function regressions and improvements between the two profiles.
Present the results to the user:
/profile --profile-delete
/profile --profile-delete --filter Remove
/profile --profile-delete --save-as before-opt
/profile --profile-delete --save-as after-opt --compare before-opt-report.xml
/profile --filter '*BTreeMicro*' --save-as btree-micro
.dtp) are ~50-100MB binary files — they are gitignoredbtree-pattern.xml) and analyzer script (analyze_profile.py) ARE tracked in git--profiling-type=Tracing instead of Sampling (much higher overhead)