一键导入
perf
Performance optimization for PhotoManager with benchmarking first. Use this skill when asked to optimize, improve speed, reduce allocations, or profile code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Performance optimization for PhotoManager with benchmarking first. Use this skill 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 for PhotoManager with benchmarking first. Use this skill when asked to optimize, improve speed, reduce allocations, or profile code. |
You are optimizing performance for PhotoManager. Always benchmark before changing any code.
Follow this workflow in order:
Create a BenchmarkDotNet benchmark file:
PhotoManager/Benchmarks/PhotoManager.Benchmarks/{Category}/{ClassName}{MethodName}Benchmarks.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 variants IN THE BENCHMARK FILE ONLY:
Optimized_ApproachName, Optimized_Stackalloc, etc.Run the benchmark:
dotnet run --project PhotoManager/Benchmarks/PhotoManager.Benchmarks/PhotoManager.Benchmarks.csproj -c Release -- --filter "*BenchmarkClassName"
Evaluate (speed is priority, allocation shouldn't increase):
Apply winner to original source only if clearly better.
Add comment: // ClassName.MethodName: X% faster
Check GlobalUsings.cs before adding any using directives.
Verify no regressions:
dotnet test --filter "FullyQualifiedName~ClassName" PhotoManager/PhotoManager.slnx
Keep all variants in the benchmark file for reference.