Agent skill
benchmark-functions
Measure function performance and compare implementations. Use when optimizing critical code paths.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/benchmark-functions
SKILL.md
Benchmark Functions
Systematically measure function execution time, memory usage, and performance characteristics to identify optimization opportunities.
When to Use
- Comparing different algorithm implementations
- Measuring performance before/after optimization
- Profiling SIMD vs scalar implementations
- Establishing performance baselines for CI/CD
Quick Reference
# Python benchmarking with timeit
python3 -m timeit -s 'import module' 'module.function(args)' -n 1000 -r 5
# Mojo benchmarking with built-in timing
mojo run benchmark_script.mojo
Workflow
- Set up benchmarks: Create timing harness with warm-up iterations
- Run measurements: Execute function multiple times, record timing
- Collect statistics: Calculate mean, median, std deviation
- Compare baselines: Compare against previous implementations
- Identify bottlenecks: Pinpoint functions needing optimization
Output Format
Benchmark report:
- Function name and parameters tested
- Execution time statistics (mean, median, min, max)
- Memory usage (if applicable)
- Comparison to baseline (improvement percentage)
- Iterations and sample size used
References
- See
profile-codeskill for detailed performance profiling - See
suggest-optimizationsskill for improvement strategies - See CLAUDE.md > Performance for Mojo optimization guidelines
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?