-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(profiler)!: New flamegraph command that profiles the opcodes exe…
…cuted (#6327) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Initial profiling to get better numbers for the opcodes actually being executed by the Brillig VM. ## Summary\* cc @sirasistant for a lot of the initial code in this PR. The noir-profiler currently only looks at compiled artifacts to generate a flamegraph showing where constraints counts and/or opcodes counts are most prominent in a program. This PR adds execution profiling sampling to be part of the ACVM/Brillig VM and the noir-profiler. This will enable us to see if there are opcodes which are being unnecessarily executed (such as array copies). This initial PR simply adds the `execution-flamegraph` command while a follow-up will add extra metadata to look at Brillig procedures. After compiling `execution_success/sha256` with `--force-brillig` we can run the following command: ``` noir-profiler execution-opcodes -a ./target/sha256.json -p ./Prover.toml -o ./target/ ``` Result for execution flamegraph: <img width="1591" alt="Screenshot 2024-10-23 at 7 17 48 PM" src="https://github.com/user-attachments/assets/c8a7f601-4431-4e86-a3e0-160facb0ec08"> To compare here is the result of `noir-profiler opcodes-flamegraph`: <img width="1589" alt="Screenshot 2024-10-23 at 7 18 12 PM" src="https://github.com/user-attachments/assets/c352ee09-26de-43da-9fdb-7c02558dfacf"> ## Additional Context This is a minor breaking change as I changed the names of the commands in the `noir-profiler` to not all be suffixed with `flamegraph`. ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [X] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Akosh Farkash <[email protected]>
- Loading branch information
Showing
15 changed files
with
385 additions
and
65 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.