ワンクリックで
perf
Performance optimization with benchmarking first. Use when asked to optimize, improve speed, reduce allocations, or profile code.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Performance optimization with benchmarking first. Use when asked to optimize, improve speed, reduce allocations, or profile code.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Add or modify tests following project conventions. Use when asked to write tests, add test coverage, or fix failing tests.
Add or modify tests for PhotoManager following project conventions. Use this skill when asked to write tests, add test coverage, or fix failing tests.
Avalonia UI reference guide for PhotoManager: UI conventions, MVVM patterns, and cross-platform UI patterns. Use this skill when working on UI code, adding image-processing methods, or needing to understand the Avalonia UI layer of the application.
Refactor code following Clean Architecture patterns. Use when asked to restructure, extract, move, or reorganize code while preserving behavior.
Avalonia UI reference guide for PhotoManager: UI conventions, MVVM patterns, and cross-platform UI patterns. Use this skill when working on UI code, adding image-processing methods, or needing to understand the Avalonia UI layer of the application.
Refactor PhotoManager code following Clean Architecture patterns. Use this skill when asked to restructure, extract, move, or reorganize code while preserving behavior.
| name | perf |
| description | Performance optimization with benchmarking first. Use when asked to optimize, improve speed, reduce allocations, or profile code. |
| disable-model-invocation | true |
| argument-hint | <class.method to optimize> |
You are tasked with optimizing the performance of: $ARGUMENTS
Follow this workflow in order:
Create a BenchmarkDotNet benchmark file:
PhotoManager/Benchmarks/PhotoManager.Benchmarks/{Category}/{ClassName}{MethodName}Benchmarks.csPhotoManager/Benchmarks/PhotoManager.Benchmarks/Common/HashingHelperCalculateHashBenchmarks.cs[MemoryDiagnoser], [Orderer(SummaryOrderPolicy.FastestToSlowest)],
[RankColumn][Benchmark(Baseline = true)]Keep the original method unchanged in its source file — do NOT modify it yet.
Add optimized implementations IN THE BENCHMARK FILE ONLY:
[Benchmark] methodOptimized_ApproachName, Optimized_Stackalloc, etc.Run the benchmark:
dotnet run --project PhotoManager/Benchmarks/PhotoManager.Benchmarks/PhotoManager.Benchmarks.csproj -c Release -- --filter "*BenchmarkClassName"
Evaluate results (speed is priority, but allocation shouldn't increase significantly):
Implement the winner in the original source file:
// ClassName.MethodName: X% fasterGlobalUsings.cs before adding any using directivesVerify: Run dotnet test --filter "FullyQualifiedName~ClassName" PhotoManager/PhotoManager.slnx
to ensure no regressions. Build must produce zero warnings.
Keep all variants in the benchmark file (original + all optimizations) for future reference.
Return benchmark results summary with percentage improvement.