بنقرة واحدة
dump-asm
// Generate assembly for code exercised by a benchmark and organize output into a baseline directory named after the current git branch. Use to generate assembly code that can be diff'd between branches.
// Generate assembly for code exercised by a benchmark and organize output into a baseline directory named after the current git branch. Use to generate assembly code that can be diff'd between branches.
| name | dump-asm |
| description | Generate assembly for code exercised by a benchmark and organize output into a baseline directory named after the current git branch. Use to generate assembly code that can be diff'd between branches. |
/dump-asm <BenchmarkName> [<Runtimes>]
$ARGUMENTS - The name of the benchmark class to run (e.g., LruJustGetOrAdd, LfuJustGetOrAdd, SketchIncrement), optionally followed by a list of one or more runtimes (e.g., net48, net9.0 or net48 net9.0)This skill orchestrates benchmark assembly generation and organizes the output for comparison.
Parse the arguments: the first argument is the benchmark name, and the optional second argument is the list of runtimes.
Delete the BenchmarkDotNet.Artifacts directory to ensure a clean run:
rm -rf BenchmarkDotNet.Artifacts
Invoke the /bench-fast skill with the provided benchmark name and optional runtime to generate assembly code:
/bench-fast <BenchmarkName> [<Runtimes>]
Invoke the /split-asm skill to generate individual assembly code files:
/split-asm
Get the current git branch name and convert it to a valid directory name by replacing forward slashes with dashes, then append the short commit hash:
git rev-parse --abbrev-ref HEAD | tr '/' '-'
git rev-parse --short HEAD
Combine these to form the directory name: <sanitized-branch-name>-<commit-hash>.
For example, branch users/alexpeck/foo at commit abc1234 becomes users-alexpeck-foo-abc1234.
Create the baseline directory structure preserving the benchmark name and runtime hierarchy. For each benchmark and runtime combination found in BenchmarkDotNet.Artifacts/results/:
BitFaster.Caching.Benchmarks.LruJustGetOrAdd → LruJustGetOrAdd)baseline/<sanitized-branch-name>-<commit-hash>/<benchmarkname>/<runtime>/BenchmarkDotNet.Artifacts/results/<full-benchmark-name>/<runtime>/ directoryThe final structure should be:
baseline/
<sanitized-branch-name>-<commit-hash>/
<benchmarkname>/
<runtime>/
<MethodName>-asm.md
<MethodName>-summary.md
...
For example:
baseline/
users-alexpeck-skills-16c32c5/
LruJustGetOrAdd/
.NET 6.0.36 (6.0.3624.51421), X64 RyuJIT AVX2/
FastConcurrentLru-asm.md
FastConcurrentLru-summary.md
...
Run a benchmark with minimal iterations to generate assembly code via BenchmarkDotNet's DisassemblyDiagnoser. Use to generate one big assembly code file per benchmark.
Split BenchmarkDotNet assembly markdown files into individual files per benchmark method using splitasm. Use to break one big assembly code file per benchmark into one file per benchmark method.