원클릭으로
haskell-perf
Improve performance of Haskell code. Use when asked to profile or improve performance.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Improve performance of Haskell code. Use when asked to profile or improve performance.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Guides for Haskell code. Use when writing Haskell code.
Replace lens with microlens-* in Haskell packages
Security audit checklist for Rust code. Use when auditing Rust code for security vulnerabilities.
Re-generate Cabal freeze files.
Reviews Haskell comments for Haddock markup opportunities. Use when reviewing or improving Haskell documentation comments.
Remove extraneous comments. Use when the user requests removing comments.
| name | haskell-perf |
| description | Improve performance of Haskell code. Use when asked to profile or improve performance. |
Purpose:
Enable profiling in cabal.project.local:
profiling: True
profiling-detail: late
package *
profiling: True
ghc-options: -fprof-late
Then rebuild:
cabal build pkg:<executable>
This takes a long time (30+ minutes) for a fresh build with profiling. Run in background.
Profile a specific test case:
# Profile with RTS stats, perf counters, heap profile, cost centers
.agents/skills/perf/scripts/profile.py <executable> <args>
# Include valgrind instruction counting if perf is not working/available
.agents/skills/perf/scripts/profile.py --with-valgrind <executable> <args>
# Output: profile-results-<timestamp>/ directory with:
# - <binary>.prof (cost center report)
# - <binary>.hp (heap profile with parsed statistics)
# - perf-stats.log (CPU performance counters: instructions, cycles, IPC, cache misses, branch misses)
# - Summary printed to stdout
While quick fixes line pragmas (INLINE, SPECIALIZE) or strictness
annotations can be helpful, it is often most impactful to make changes to the
overall algorithm or structure of the computation. Instead of just looking
locally at the cost centers, think broadly about the context. Why is this
function a hot spot? What could be done to restructure the computation more
broadly? Don't be afraid to make big changes.
For each improvement identified, follow these steps:
profile.pyperf branch on that submodule before making changesprofiile.py and compare the metricsCRUCIAL!
You MUST collect before/after measurements using profile.py for each change.
Make only one change at a time.
Wall clock time is noisy, it's not even worth measuring. DO NOT USE wall-clock time.