baphled/dotopencode/benchmarking
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Go benchmarking for measuring and optimising code performance
Install
npx vskill@latest install baphled/dotopencode/benchmarkingSKILL.md
Skill: benchmarking
What I do
I provide Go-specific benchmarking expertise to measure and optimise code performance. I focus on writing reliable benchmarks using the testing package and analysing results to identify bottlenecks.
When to use me
- When comparing the performance of multiple implementations
- When verifying the impact of an optimisation
- When identifying hotspots in performance-critical code paths
Core principles
- Isolation: Run benchmarks in a stable environment to minimise noise.
- Reliability: Use
b.ResetTimer()to exclude setup overhead andb.ReportAllocs()to track memory allocations. - Statistical significance: Use tools like
benchstatto compare results across multiple runs. - Realistic data: Use representative input sizes to avoid misleading results from small or trivial datasets.
Patterns & examples
Standard benchmark function:
Table-driven benchmark:
Comparing results: Use go test -bench . -count 5 > old.txt and go test -bench . -count 5 > new.txt, then run benchstat old.txt new.txt to see the percentage change.
Anti-patterns to avoid
- ❌ Looping manually: Always use
b.Nfor the loop count. Hardcoding iterations leads to unreliable timing. - ❌ Compiler optimisations: Ensure the result of the function under test is used (e.g., assigned to a package-level variable) to prevent the compiler from eliding the call.
- ❌ Ignoring allocations: High memory allocation counts often indicate performance issues that timing alone might miss.
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Performance-Profiling/Benchmarking.md
Related skills
profiling: For deep dives into where time or memory is spentperformance: General optimisation principles and techniquesgolang: For idiomatic Go patterns and standard library usage
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/benchmarking/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/baphled/dotopencode/benchmarking)