Back to list
antonykamp

tracing-execution-counts

by antonykamp

A Claude plugin for analyzing and optimizing Truffle performance

0🍴 0📅 Jan 22, 2026

SKILL.md


name: tracing-execution-counts description: Counts exact execution frequencies (not time) at function/statement level. Shows interpreted vs compiled execution split. Use to verify functions compile (>95% compiled), understand control flow patterns, and validate algorithmic complexity. Complements profiling-with-cpu-sampler by showing frequency rather than duration.

Tracing Execution Counts

Counts exact execution frequencies (NOT time) at function and statement level. Complements CPU Sampler by showing HOW OFTEN code runs rather than how much time it takes.

When to Use This Skill

  • Verify functions are compiling (aim for >95% compiled executions)
  • Understand control flow patterns
  • Validate algorithmic complexity (O(n) vs O(n²))
  • Quantify how often code paths execute

Quick Start

# Basic execution count tracing
<launcher> --cputracer <program>

# With tier breakdown (RECOMMENDED)
<launcher> --cputracer --cputracer.TraceTiers=true <program>

# Per-statement granularity
<launcher> --cputracer --cputracer.TraceStatements=true <program>

⚠️ REQUIRED: Fermi Verification (Every Tool Invocation)

Before running:

  • Pre-calculate: Expected call counts (based on algorithm complexity, e.g., O(n²) for nested loops)
  • Smoke test: <launcher> --cputracer -c 'var x = 0; for (var i = 0; i < 10; i = i + 1) { x = x + 1; }' → Verify counts

After running:

  • Validate: Counts within 1 OOM of estimate? YES / NO
  • If NO: STOP - Either algorithm issue or wrong estimate (recalculate)
  • Save output: tool-outputs/cpu-tracer-[benchmark].txt

Gate: All boxes checked? → Proceed to analysis

Key Options

OptionDescriptionRecommended
--cputracer.TraceTiers=trueShow interpreted vs compiledAlways use
--cputracer.TraceStatements=trueStatement-level detailWhen needed
--cputracer.FilterRootName=<name>Filter by functionFocus analysis
--cputracer.Output=jsonJSON outputFor parsing
--cputracer.OutputFile=<file>Save to fileFor analysis

Understanding Output

Sample Output with Tiers

Tracing Histogram. Counted 1234567 executions.

Name          || Count       || Interpreted | Compiled
queens        || 500000 40%  || 2.1%        | 97.9%      ✅
hasConflict   || 750000 60%  || 1.8%        | 98.2%      ✅

Interpretation

Compiled %StatusAction
>95%✅ GoodCode is well-optimized
80-95%⚠️ CheckMay have warmup or minor issues
<80%❌ ProblemCompilation failures or deoptimization

Key Insights

Frequency vs Time

  • CPU Sampler: Shows WHERE time is spent
  • CPU Tracer: Shows HOW OFTEN code runs

A function called 1M times at 1µs each = 1 second total. A function called 100 times at 10ms each = 1 second total.

Same time, very different optimization strategies!

Algorithmic Complexity

Expected for queens(N=8):
- hasConflict called ~92 times per queen placement
- Total calls = O(N!)

If counts much higher → algorithm issue
If counts much lower → early termination bug

Integration with Other Skills

FindingNext Skill
Low compiled %tracing-compilation-events
Unexpected countsReview algorithm
Hot functionsprofiling-with-cpu-sampler for time
  • profiling-with-cpu-sampler - Time-based profiling
  • tracing-compilation-events - Why compilation fails
  • detecting-performance-warnings - Optimization barriers

Reference

<launcher> --help:cputracer

Score

Total Score

55/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon