build-perf-baseline
Fungsinya
Skill ini menyiapkan pengukuran waktu build yang adil untuk proyek .NET agar perbaikan bisa dibuktikan. Skill ini untuk tim yang ingin tahu seberapa lambat build yang sebenarnya sebelum mengubah apa pun.
Kapan dipakai
- โSaat build .NET lambat dan Anda ingin angka yang andal sebelum mengubah apa pun.
- โSaat Anda ingin membandingkan build sebelum dan sesudah perubahan.
- โSaat Anda ingin mengukur build dingin, hangat, dan tanpa perubahan secara terpisah.
Link skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/build-perf-baseline/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โUkur berapa lama solusi .NET saya dibuild dalam keadaan dingin dan setelah perubahan kecil, supaya kami punya dasar pembanding.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menjaga pengaturan tetap sama di setiap run, mengulangi setiap skenario beberapa kali, menyimpan log untuk setiap sampel, lalu melaporkan median dan rentangnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Build Performance Baseline & Optimization
Overview
Before optimizing a build, you need a baseline. Without measurements, optimization is guesswork. This skill covers how to establish baselines and apply systematic optimization techniques.
Related skills:
build-perf-diagnosticsโ binlog-based bottleneck identificationincremental-buildโ Inputs/Outputs and up-to-date checksbuild-parallelismโ parallel and graph build tuningeval-performanceโ glob and import chain optimization
Step 1: Establish a Performance Baseline
Measure three scenarios to understand where time is spent. Keep the SDK, configuration, machine, environment variables, restore state, and build command consistent. Run each scenario at least three times, repeating its setup before every measured sample, and report the median plus the observed range; a single timing is not a baseline. Keep setup outside the timed interval. Save each sample's binlog under a unique name, outside generated output directories.
Cold Build (First Build)
No previous build output exists. Measures the full end-to-end time including restore, compilation, and all targets.
Before every cold sample, restore the same source state, run dotnet clean
with the measured configuration, and remove only the confirmed, disposable
output and intermediate directories for the measured projects. Include custom
artifact paths, not just bin and obj, and obtain approval before deletion.
Verify those outputs are absent before timing the next build.
This is an output-cold build, not necessarily a cold NuGet, OS, or compiler server cache. Choose and record a consistent cache/server policy for all samples; do not clear shared caches. If measuring uncached restore, use a separate, empty package cache for each sample.
# After repeating the cold setup; use a unique log name for each sample
dotnet build /bl:cold-build-1.binlog -m
Warm Build (Incremental Build)
Build output exists, some files have changed. Measures how well incremental build works.
Before every warm sample, restore the same baseline source contents and build successfully without timing it. Then apply the same small, build-relevant edit to the same source file and time the build. Keep the changed file set and edit identical across samples; do not let edits accumulate. Restore the baseline contents before the next sample and rebuild them outside the timed interval. Do not clean between that setup build and its measured build.
# Untimed setup after restoring baseline source contents
dotnet build -m
# Apply the same controlled source edit, then measure with a unique log name
dotnet build /bl:warm-build-1.binlog -m
No-Op Build (Nothing Changed)
Build output exists, nothing has changed. Compilation and correctly incremental targets should skip; compare timing with this build's other samples.
Before every no-op sample, restore the same baseline source contents and run an untimed setup build successfully. Then measure an identical build without edits, touching inputs, cleaning outputs, or changing properties. Keep restore and cache/server policy consistent with the other samples.
# Untimed setup after restoring baseline source contents
dotnet build -m
# Rebuild immediately without changes; use a unique log name for each sample
dotnet build /bl:noop-build-1.binlog -m
What Good Looks Like
| Scenario | Expected Behavior |
|---|---|
| Cold build | Full compilation, all targets run. This is your absolute baseline |
| Warm build | Only changed projects recompile. Time proportional to change scope |
| No-op build | Compilation and correctly incremental custom targets skip; compare duration with this repo's repeated warm and cold samples |
Red flags:
- No-op time is repeatedly close to warm/cold time, or compilation targets rerun โ investigate incrementality (see
incremental-build) - Warm build recompiles everything โ project dependency chain forces full rebuild
- Restore dominates cold samples โ measure
dotnet restoreanddotnet build --no-restoreseparately before changing project structure
Do not use universal duration or percentage thresholds to declare a bottleneck. Rank costs against the controlled samples and the build's own target/task timings.
Capture analyzer evidence
A binlog shows compiler/task timing, but granular analyzer timing requires an analyzer-reporting run. When su
Pertanyaan umum
Mengapa menjalankan setiap skenario beberapa kali?
Satu pengukuran bisa berderau, jadi pengulangan memberi dasar yang adil beserta rentangnya.
Apa itu build dingin?
Build dingin adalah build pertama tanpa keluaran sebelumnya, termasuk restore dan semua kompilasi.
Apakah skill ini memperbaiki build yang lambat?
Tidak. Skill ini mengukur dulu, dan skill diagnostik mencari penyebabnya.
Detail
Deskripsi asli dari pembuat
Establish MSBuild/.NET build performance baselines before optimizing. USE FOR: unranked slow builds; cold, warm, incremental or no-op measurements; before/after comparisons; CI output caching; static graph, artifacts output and dependency graph trimming. Start here before build-perf-diagnostics, incremental-build or build-parallelism. DO NOT USE FOR: known repeated-restore fixes (use eliminate-redundant-restores), non-MSBuild builds. For measured target/task/analyzer bottlenecks, use build-perf-diagnostics.
repo: dotnet/skills
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14593
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
create-custom-agent
5.8kMembantu agent Anda membuat file agen kustom VS Code dengan alatnya sendiri, instruksi, dan serah terima ke agent lain.
create-skill
5.8kMembantu agent Anda membuat skill agent baru dengan nama yang valid, deskripsi pemicu yang jelas, dan file SKILL.md yang mengikuti standar.
csharp-scripts
5.8kMembantu agent Anda menjalankan program C# kecil sebagai satu file dengan alat baris perintah .NET, tanpa membuat proyek lengkap.
dotnet-pinvoke
5.8kMembantu agent Anda memanggil pustaka native C atau C++ dari .NET dengan benar, mencakup tanda tangan, penanganan string, memori, dan safe handle.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.