性能剖析与优化
Performance profiling & optimization
Profile CPU, memory or rendering, find the hotspot and speed it up to a target.
20 条本项目编写的提案 · 分类 v1.1 · 新增基准运行 0 次。下方验证方式与部分得分规则是设计,不是执行结果。
- 典型应用
- Instruments · perf · Chrome DevTools · VTune
- 小类 GUI 需求标签
HY· 混合
任务提案 · 20
展开查看完整原文与建议检查方式;两种界面均保留提案英文原文。
R02.03.01.02-T01 Profile and speed up a Python report generator 3x
原始指令
`/work/salesreport` takes ~60 s to build `report.xlsx` from `fixtures/orders.parquet`. Profile it (cProfile + snakeviz or py-spy), save the profile to `prof/before.prof`, and optimize the hotspots so the run is at least 3x faster with an identical workbook. Save `prof/after.prof`.
- 平台
lin· Linuxmac· macOSwin· Windows- 应用
- cProfile · snakeviz · py-spy
- 交互表面
term· 终端brow· 浏览器- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 2 / 5
建议验证方式
Grader box timing (median of 5): speedup >= 3x vs baseline; output workbook cell values and formats identical (openpyxl diff); both .prof files load and after.prof total time lower; hidden tests green.
建议部分得分
Linear 1x->3x speedup (60%); 30% identical output; 10% profiles saved
R02.03.01.02-T02 Remove scrolling jank in a macOS app using Instruments Time Profiler
原始指令
The macOS app `PhotoGrid` (Xcode project) stutters when scrolling a 5,000-item grid. Profile with Instruments (Time Profiler + Animation Hitches), save the trace to `traces/before.trace`, fix the main-thread hotspots, and record `traces/after.trace` showing hitches resolved.
- 平台
mac· macOS- 应用
- Instruments · Xcode
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
HY· 混合- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Hidden XCUITest scroll benchmark (XCTOSSignpostMetric scrollDecelerationMetric): hitch time ratio < 5 ms/s on grader Mac (baseline ~40); both .trace bundles exist and after shows lower main-thread sample count; UI snapshot tests unchanged.
建议部分得分
50% hitch target (linear); 20% visual output unchanged; 30% traces recorded before/after
R02.03.01.02-T03 Find a C++ service hotspot with perf and flame graphs, then fix it
原始指令
`/work/geoindex` (C++) answers range queries at 12k qps; the target is 18k qps. Use `perf record -g` and generate a flame graph (`flame.svg`) to find the hotspot, then optimize it (algorithm or data layout), keeping results identical.
- 平台
lin· Linux- 应用
- perf · FlameGraph · CMake
- 交互表面
term· 终端brow· 浏览器- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Grader benchmark on pinned cores: >= 18k qps (linear credit from 12k); query results identical on 100k queries; flame.svg present and generated from perf data of this binary (embedded symbol names).
建议部分得分
60% throughput (linear); 30% identical results; 10% flame graph
R02.03.01.02-T04 Cut long tasks on a page to meet an INP budget using the Performance panel
原始指令
The sandbox product-filter page in `/work/shop-web` has INP around 600 ms when toggling filters on a mid-tier CPU (4x throttling). Use the Chrome DevTools Performance panel to find long tasks, save the profile JSON, and optimize so INP < 200 ms under the same throttling, with identical filtering results.
- 平台
mac· macOSwin· Windowslin· Linux- 应用
- Chrome DevTools · Vite
- 交互表面
brow· 浏览器desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击vis· 视觉判断code· 代码与命令- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Hidden Playwright + web-vitals run with CPU 4x throttle: p75 INP over 30 interactions < 200 ms; DOM results identical to reference for 20 filter combos; saved profile JSON shows the original long task.
建议部分得分
60% INP target (linear 600->200); 30% identical results; 10% profile saved
R02.03.01.02-T05 Vectorize a memory-bound loop guided by Intel VTune
原始指令
`/work/stencil3d` (C++/OpenMP) runs a 7-point stencil at 30 GFLOP/s on the grader's Xeon. Use VTune (Hotspots, Memory Access and Roofline) to diagnose, save the result directory, and restructure (tiling, vectorization, alignment) to reach >= 60 GFLOP/s with results within 1e-12 of baseline.
- 平台
lin· Linuxwin· Windows- 应用
- Intel VTune · Intel Advisor · icx/gcc
- 交互表面
desk· 桌面 GUIterm· 终端- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断nav· 平移 / 缩放 / 滚动- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Grader run: GFLOP/s >= 60 (linear credit from 30); max abs diff <= 1e-12 on 3 grids; VTune result dir present with memory-access analysis of the baseline.
建议部分得分
60% throughput (linear); 30% numerics; 10% analysis evidence
R02.03.01.02-T06 Halve app startup time on Windows using WPR/WPA
原始指令
`C:\work\Planner` (.NET WPF) takes ~4.2 s to show its main window. Record a startup trace with Windows Performance Recorder, analyze in Windows Performance Analyzer (CPU usage sampled, disk I/O, file I/O), save the .etl, and reduce time-to-main-window below 2.0 s.
- 平台
win· Windows- 应用
- WPR · WPA · Visual Studio
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Grader measures time from process start to main window ETW event (median of 10 cold starts): < 2.0 s (linear from 4.2); functional UI smoke test passes; startup.etl present.
建议部分得分
60% startup target (linear); 30% functionality; 10% trace saved
R02.03.01.02-T07 Unblock a Node event loop identified with clinic.js
原始指令
`/work/api-node` p99 latency spikes to 900 ms under load. Run clinic doctor and flame (or 0x), save the HTML reports to `perf/`, find the synchronous work blocking the event loop, and fix it so p99 < 120 ms at 500 rps with identical responses.
- 平台
lin· Linuxmac· macOS- 应用
- clinic.js · autocannon · Node
- 交互表面
term· 终端brow· 浏览器- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Grader autocannon run (500 rps, 60 s): p99 < 120 ms (linear credit from 900); response bodies identical on 1,000 sampled requests; event-loop delay max < 50 ms; perf/ reports present.
建议部分得分
60% latency target; 25% identical responses; 15% reports
R02.03.01.02-T08 Halve allocations in a .NET service with the Visual Studio profiler
原始指令
`C:\work\Quotes` (.NET 8 API) allocates ~1.4 GB/min under the provided load script, causing gen2 GCs. Use the Visual Studio .NET Object Allocation tool, save the `.diagsession`, and reduce allocations by >= 50% without changing outputs.
- 平台
win· Windows- 应用
- Visual Studio Profiler · dotnet-counters
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
HY· 混合- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
dotnet-counters during grader load: alloc rate <= 50% of baseline and gen2 count reduced; response bodies identical; BenchmarkDotNet hidden benchmarks no slower; diagsession present.
建议部分得分
60% allocation reduction (linear up to halving); 25% identical outputs; 15% artifacts
R02.03.01.02-T09 Speed up a slow reporting SQL query 10x using EXPLAIN ANALYZE
原始指令
In the Postgres DB from `/work/analytics-db`, the query in `slow.sql` takes ~14 s. Use EXPLAIN (ANALYZE, BUFFERS) to find the bottleneck, then rewrite the query and/or add indexes (migration file in `migrations/`) so it runs in < 1.4 s with the exact same result set.
- 平台
lin· Linuxmac· macOSwin· Windows- 应用
- Postgres · psql
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Grader runs new query 5 times on a fresh DB with migration applied: median < 1.4 s; result set identical (ordered hash); other benchmark queries not slower by > 10%; index count added <= 3.
建议部分得分
60% speed (linear); 30% identical result; 10% no regressions
R02.03.01.02-T10 Fix a detached-DOM memory leak using heap snapshots
原始指令
The sandbox dashboard SPA in `/work/ops-dash` grows ~30 MB per route change. Use Chrome DevTools Memory panel heap snapshots (compare before/after 10 navigations), save both `.heapsnapshot` files, find the retainers of detached DOM trees, and fix the leak.
- 平台
mac· macOSwin· Windowslin· Linux- 应用
- Chrome DevTools
- 交互表面
brow· 浏览器desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Hidden Playwright test: JS heap after 100 route changes and forced GC within 5 MB of after 10; detached node count < 50; app behavior tests pass; snapshot files present and contain the leaking class name.
建议部分得分
60% leak fixed; 25% functionality; 15% snapshots
R02.03.01.02-T11 Find a memory growth in a Mac app with Instruments Allocations and Leaks
原始指令
The macOS app `MailPreview` grows 200 MB per hour while idle with an account syncing. Use Instruments Allocations (generations/mark heap) and Leaks, save the trace, identify the retain cycle or unbounded cache, and fix it so memory stays flat over a 30-minute accelerated sync test.
- 平台
mac· macOS- 应用
- Instruments · Xcode
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Hidden test runs accelerated sync 30 min: footprint growth < 10 MB; Leaks reports none; trace saved with a generation analysis; UI tests unchanged.
建议部分得分
60% memory flat; 20% no leaks; 20% trace evidence
R02.03.01.02-T12 Profile a live Python web service with py-spy and fix the hotspot
原始指令
The Flask service in `/work/geocoder` (running under gunicorn in Docker) uses 100% CPU at 50 rps. Without restarting it, attach `py-spy record` to a worker for 60 s and save `profile.svg`, then fix the hotspot so CPU at 50 rps is < 30% with identical responses.
- 平台
lin· Linux- 应用
- py-spy · Docker · gunicorn
- 交互表面
term· 终端brow· 浏览器- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Grader load test at 50 rps: container CPU < 30% (linear from 100%); responses identical for 2,000 requests; profile.svg present, generated by py-spy from a live PID (metadata).
建议部分得分
60% CPU target; 30% identical responses; 10% profile
R02.03.01.02-T13 Overlap CUDA transfers and kernels guided by Nsight Systems
原始指令
`/work/batchinfer` (CUDA C++) processes 1,000 image batches in 9.5 s on the grader GPU with idle gaps. Capture a timeline with Nsight Systems (`.nsys-rep`), identify serialization between H2D copies, kernels and D2H, and restructure with streams/pinned memory to finish in < 5 s with identical outputs.
- 平台
lin· Linux- 应用
- Nsight Systems · nvcc
- 交互表面
desk· 桌面 GUIterm· 终端- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断nav· 平移 / 缩放 / 滚动- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 5 / 5
建议验证方式
Grader run: wall time < 5 s (linear from 9.5); output tensor checksums identical; nsys report shows >= 2 concurrent streams with overlapping memcpy and kernel ranges.
建议部分得分
60% time target; 25% identical outputs; 15% overlap evidenced in timeline
R02.03.01.02-T14 Remove frame jank in an Android list with the Android Studio profiler
原始指令
The `NewsFeed` Android app janks while scrolling (frames > 16 ms). Use Android Studio's CPU profiler and System Trace, save the trace, find the main-thread work (image decoding, layout passes), and fix it so > 95% of frames render under 16 ms on the emulator benchmark.
- 平台
mac· macOSwin· Windowslin· Linuxand· Android- 应用
- Android Studio Profiler · Macrobenchmark
- 交互表面
desk· 桌面 GUImob· 移动触控- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Hidden Macrobenchmark FrameTimingMetric: p95 frame duration < 16 ms (baseline 38); list content screenshots identical; trace file present.
建议部分得分
60% frame target; 25% visual parity; 15% trace
R02.03.01.02-T15 Raise a marketing page's Lighthouse performance score to 90+
原始指令
The sandbox landing page `/work/landing` scores 41 on Lighthouse mobile. Use Lighthouse and the DevTools Performance/Network panels to find the causes (render-blocking CSS, unoptimized hero image, layout shift, third-party script), fix them, and reach >= 90 without changing the visible design.
- 平台
mac· macOSwin· Windowslin· Linux- 应用
- Lighthouse · Chrome DevTools
- 交互表面
brow· 浏览器desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击vis· 视觉判断code· 代码与命令- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Grader Lighthouse CI (3 runs, median, mobile): performance >= 90 (linear from 41); CLS < 0.1; full-page screenshot SSIM >= 0.97 vs original design at 3 viewports.
建议部分得分
60% score (linear); 15% CLS; 25% design unchanged
R02.03.01.02-T16 Reduce allocations in a Go service using pprof
原始指令
`/work/logagg` (Go) spends 40% of CPU in GC. Capture CPU and alloc profiles via net/http/pprof under the load script, inspect with `go tool pprof -http`, save `cpu.pb.gz` and `allocs.pb.gz`, and cut allocations per request by >= 60%.
- 平台
lin· Linuxmac· macOS- 应用
- pprof · go
- 交互表面
term· 终端brow· 浏览器- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 3 / 5
建议验证方式
Hidden benchmark: allocs/op <= 40% of baseline; ns/op not worse; output identical on corpus; profile files present and parseable.
建议部分得分
60% alloc target (linear); 15% speed not worse; 15% identical output; 10% profiles
R02.03.01.02-T17 Double the throughput of a Rust parser measured with criterion
原始指令
Crate `/work/fastcsv` parses at 450 MB/s on the criterion benchmark. Profile with `cargo flamegraph` or samply, then optimize (SIMD scanning, fewer bounds checks, buffer reuse) to >= 900 MB/s while remaining safe Rust except for documented, tested `unsafe` blocks.
- 平台
lin· Linuxmac· macOS- 应用
- cargo · criterion · samply
- 交互表面
term· 终端brow· 浏览器- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 4 / 5
建议验证方式
Grader criterion run on pinned CPU: >= 900 MB/s (linear from 450); differential fuzz vs baseline 10 min no mismatch; every unsafe block has a SAFETY comment and Miri passes on unit tests.
建议部分得分
60% throughput; 25% correctness fuzz; 15% unsafe hygiene
R02.03.01.02-T18 Fix the top query by pg_stat_statements in a Postgres app
原始指令
The sandbox app DB has `pg_stat_statements` enabled after a day of synthetic traffic. Identify the query with the highest total execution time, write its normalized text to `TOP.sql`, and add the single index that best fixes it (migration in `migrations/`), verifying with EXPLAIN.
- 平台
lin· Linuxmac· macOSwin· Windows- 应用
- Postgres · psql · pgAdmin
- 交互表面
term· 终端- GUI 需求 · 任务设定
CL· CLI 足够- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
code· 代码与命令- 工作产物
WP06· 代码 / 工程- 条件
- 未声明
- 提案难度
- 2 / 5
建议验证方式
TOP.sql matches the seeded top query (normalized); after migration, that query's mean time drops >= 10x in the replay; exactly one index added; replay of all other queries not slower than 10%.
建议部分得分
40% correct query; 50% speedup; 10% single index
R02.03.01.02-T19 Bring a Unity scene's frame time under 16.6 ms using the Profiler
原始指令
In the Unity project `/work/CityDemo`, the `Downtown` scene runs at ~38 ms/frame on the grader GPU. Use the Unity Profiler and Frame Debugger to find the costs (draw calls, GC allocs in Update, expensive shadows), save the profiler capture, and reach a mean frame time < 16.6 ms on the scripted camera path without visible changes beyond tolerance.
- 平台
win· Windowsmac· macOS- 应用
- Unity Editor · Unity Profiler
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
G2· GUI 必要- GUI 需求 · 普通权限
HY· 混合- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
licensed· 授权专业软件- 提案难度
- 5 / 5
建议验证方式
Grader player build runs the camera path: mean frame time < 16.6 ms (linear from 38), GC alloc per frame < 1 KB; 10 checkpoint frames SSIM >= 0.95 vs original; .data profiler capture present. Unity -batchmode launches and Profiler.logFile/Profiler API capture scripts are detected (process audit, script diff) and void the capture milestone.
建议部分得分
50% frame time; 15% GC allocs; 25% visual parity; 10% capture
R02.03.01.02-T20 Cut an Electron app's idle CPU from 12% to under 2%
原始指令
The Electron app `/work/notes-desktop` uses ~12% CPU while idle. Using Chrome DevTools for renderer and main processes plus the OS profiler (Instruments on macOS or WPA on Windows), find all idle work sources (timers, animations, IPC polling, a spinner hidden offscreen), save the traces, and reduce idle CPU below 2% on both OSes.
- 平台
mac· macOSwin· Windows- 应用
- Chrome DevTools · Instruments · WPA
- 交互表面
desk· 桌面 GUI- GUI 需求 · 任务设定
HY· 混合- GUI 需求 · 普通权限
CL· CLI 足够- 交互原语
click· 指向与点击nav· 平移 / 缩放 / 滚动vis· 视觉判断- 工作产物
WP06· 代码 / 工程- 条件
multiapp· 多应用- 提案难度
- 5 / 5
建议验证方式
Grader measures idle CPU over 5 min after 1 min settle on mac and Windows VMs: < 2% both (linear from 12); functional E2E tests pass; traces from both OS profilers present.
建议部分得分
35% macOS target; 35% Windows target; 20% functionality; 10% traces
已有研究映射
以下沿用研究目录中的基准与小类映射,不是逐题标注、执行记录或产品背书。