Skip to content

nightly-2024-03-29: chore: Pretty print timings for codegen (#4659)

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 29 Mar 02:10
· 1420 commits to master since this release
05b32fc
# Description

## Problem\*

Resolves https://github.com/noir-lang/noir/issues/4658

## Summary\*

I was already timing things for a separate issue so I decided to push
this PR. I felt this provided a nice temporary solution. If we deem that
the `tracing` crate can still be used for pretty printing the timings of
each codegen pass we can switch to that in a follow-up, and for now this
provides an easy way to check the timings of each codegen pass.

Example output:
```
After Defunctionalization:: 0 ms
After Removing Paired rc_inc & rc_decs:: 0 ms
After Inlining:: 0 ms
After Mem2Reg:: 0 ms
After Assert Constant:: 0 ms
After Unrolling:: 13 ms
After Simplifying:: 0 ms
After Flattening:: 9 ms
After Removing Bit Shifts:: 0 ms
After Mem2Reg:: 19 ms
After Constant Folding:: 3 ms
After Constraint Folding:: 3 ms
After Dead Instruction Elimination:: 0 ms
SSA to Brillig: 0 ms
SSA to ACIR: 14 ms
``` 

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: jfecher <jake@aztecprotocol.com>