Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating debug information after optimizing a circuit is way too slow. #3809

Closed
TomAFrench opened this issue Dec 14, 2023 · 0 comments · Fixed by #3815
Closed

Updating debug information after optimizing a circuit is way too slow. #3809

TomAFrench opened this issue Dec 14, 2023 · 0 comments · Fixed by #3815

Comments

@TomAFrench
Copy link
Member

I've known this has been an issue for a while but I've just got some concrete numbers to attach to this as I've been adding some tracing information which gives timing info on various stages of the compilation process.

If I compile @Savio-Sou's benchmarking program https://github.com/Savio-Sou/noir-benchmarks/blob/ef449ae6de730b7741b243314ab91c90336e7e08/2%5E19/src/main.nr then

[2023-12-14T17:06:42Z TRACE noirc_driver] Start checking crate
[2023-12-14T17:06:42Z TRACE noirc_driver] Finish checking crate
[2023-12-14T17:06:42Z TRACE noirc_frontend::monomorphization] Start monomorphization
[2023-12-14T17:06:42Z TRACE noirc_frontend::monomorphization] Finish monomorphization
[2023-12-14T17:06:42Z TRACE noirc_evaluator::ssa] Start circuit generation
[2023-12-14T17:06:42Z TRACE noirc_evaluator::ssa] Start SSA generation
[2023-12-14T17:06:45Z TRACE noirc_evaluator::ssa] Finish SSA generation
[2023-12-14T17:06:45Z TRACE noirc_evaluator::ssa] Start ACIR generation
[2023-12-14T17:06:47Z TRACE noirc_evaluator::ssa] Finish ACIR generation
[2023-12-14T17:06:47Z TRACE acvm::compiler::optimizers] Start circuit optimization
[2023-12-14T17:06:48Z TRACE acvm::compiler::optimizers] Finish circuit optimization
[2023-12-14T17:06:48Z TRACE noirc_errors::debug_info] Start debug info update
[2023-12-14T17:08:27Z TRACE noirc_errors::debug_info] Finish debug info update
[2023-12-14T17:08:27Z TRACE noirc_evaluator::ssa] Finish circuit generation
[2023-12-14T17:08:27Z TRACE acvm::compiler::optimizers] Start circuit optimization
[2023-12-14T17:08:28Z TRACE acvm::compiler::optimizers] Finish circuit optimization
[2023-12-14T17:08:28Z TRACE acvm::compiler::transformers] Start circuit transformation
[2023-12-14T17:08:28Z TRACE acvm::compiler::transformers] Finish circuit transformation
[2023-12-14T17:08:28Z TRACE noirc_errors::debug_info] Start debug info update
[2023-12-14T17:10:07Z TRACE noirc_errors::debug_info] Finish debug info update

A fresh compile takes ~3:25 to complete, of which ~2:19 is spent just updating the debug information.

github-merge-queue bot pushed a commit that referenced this issue Dec 15, 2023
# Description
Same as #3814 but with a different
approach, by building the map of old to new inside AcirTransformationMap
## Problem\*

Resolves #3809

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant