Skip to content

Comments

feat: add aztec profile command with gate count profiling#20695

Merged
nchamo merged 2 commits intomerge-train/fairiesfrom
feat/aztec-profile-v2
Feb 20, 2026
Merged

feat: add aztec profile command with gate count profiling#20695
nchamo merged 2 commits intomerge-train/fairiesfrom
feat/aztec-profile-v2

Conversation

@nchamo
Copy link
Contributor

@nchamo nchamo commented Feb 19, 2026

Summary

Adds a new aztec profile command that profiles compiled Aztec artifacts. The first subcommand, aztec profile gates, displays gate counts for all compiled contracts and circuits in a target directory.

This is the beginning of a profiling suite for Aztec developers. The flamegraph command will be added as a subcommand under aztec profile next, consolidating all profiling tools in one place. Running bare aztec profile shows help listing available subcommands.

Sample output (on the test workspace with a simple contract and two circuits):

Gate counts:
------------------------------------------------------------------------
simple_circuit                                                      45
simple_circuit_2                                                    46
simple_contract-SimpleContract::another_private_function         5,616
simple_contract-SimpleContract::private_function                 5,540
------------------------------------------------------------------------
Total: 4 circuit(s)

Addresses #20323

@ludamad
Copy link
Collaborator

ludamad commented Feb 19, 2026

Commented on other one, but why not aztec simulate?

@ludamad
Copy link
Collaborator

ludamad commented Feb 19, 2026

and why does this not touch yarn-project/cli-wallet/src/utils/profiling.ts

@nchamo
Copy link
Contributor Author

nchamo commented Feb 19, 2026

Hey @ludamad !

Sorry, had to delete the other PR I was having issues with it. What do you say if we discuss the need (or not) for this change at #20323 directly?

Then we can circle back and discuss the implementation here

@ludamad
Copy link
Collaborator

ludamad commented Feb 19, 2026

good with it after chatting

@nchamo nchamo self-assigned this Feb 19, 2026
@nchamo nchamo requested a review from mverzilli February 19, 2026 19:14
Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@nchamo nchamo merged commit 40da7cb into merge-train/fairies Feb 20, 2026
13 of 14 checks passed
@nchamo nchamo deleted the feat/aztec-profile-v2 branch February 20, 2026 17:43
@benesjan
Copy link
Contributor

benesjan commented Feb 21, 2026

@nchamo in our merge train PR the profile_gates.test.ts test is failing.

What is weird that locally it passes:

image

Do you have a clue why this might be the case?

Could it be some stale artifacts in CI issue or something? (this tends to be the case when a failure is only in CI)

Can help debug.

@nchamo
Copy link
Contributor Author

nchamo commented Feb 21, 2026

@benesjan I run into the same issue on my CI. I think that the compile.test and profile_gates.test.ts mess with each other since both compile + clean things up

I'm making them run sequentially here:
#20741

@benesjan
Copy link
Contributor

Perfect. Thanks!

github-merge-queue bot pushed a commit that referenced this pull request Feb 23, 2026
BEGIN_COMMIT_OVERRIDE
refactor: aztec new and init creating 2 crates (#20681)
fix: hodgepodge of small things (#20720)
test: aztec new scaffold works (#20711)
feat: add `aztec profile` command with gate count profiling (#20695)
fix(txe): committing after txs (#20714)
feat: add aztec profile flamegraph command (#20741)
feat: printing out public contract function debug logs in a tx (#20749)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants