benchmarking-cairo

Profile Cairo functions and export hotspot visualizations as PNG files.

259|90|Updated Jan 2, 2023
One-click install
npx skills add https://github.com/keep-starknet-strange/garaga --skill benchmarking-cairo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: benchmarking-cairo
Source: https://github.com/keep-starknet-strange/garaga/tree/main/.claude/skills/benchmarking-cairo
Command: npx skills add https://github.com/keep-starknet-strange/garaga --skill benchmarking-cairo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Profiles Cairo functions to reveal hotspots, track step counts, and visualize resource usage.

Core Features & Use Cases

  • Applicable to both scarb executables and snforge tests, providing end-to-end profiling from trace generation to PNG export in Cairo projects.
  • Produces a deterministic pb.gz profile and a PNG visualization for quick hotspot analysis and performance review.
  • Useful for optimizing Cairo code, validating performance regressions, and guiding refactors with trace-based insights.

Quick Start

From this skill directory, run python3 profile.py profile --mode snforge --package <package> --test <test> --name <profile-name> --metric steps to generate a profile and PNG.

Frequently Asked Questions about benchmarking-cairo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile Cairo functions to find performance hotspots?

You can profile Cairo functions by running the profile.py CLI with scarb or snforge to generate traces, build a pb.gz profile, and export a PNG visualization for quick performance hotspot analysis.

Can I use this profiling tool with snforge tests?

Yes, this profiling approach works with both snforge tests and scarb executables. It coordinates trace generation through the profile.py CLI to provide end-to-end profiling for Cairo projects.

What is the best way to track step counts in Cairo code?

The best way to track step counts in Cairo code is by running profile.py with the steps metric. It generates a deterministic pb.gz profile and a PNG visualization to reveal resource usage hotspots.

How do I generate a PNG visualization from a Cairo trace?

You generate a PNG visualization from a Cairo trace by using the profile.py CLI which coordinates with cairo-profiler, pprof, and Graphviz to produce reproducible visual results from your trace data.

Does profiling Cairo code with this approach require external dependencies?

Profiling Cairo code with this approach coordinates with cairo-profiler, pprof, and Graphviz to build profiles and export visualizations. These external tools are orchestrated automatically by the profile.py CLI.