Skip to content

Commit 9e5208d

Browse files
authored
chore: add a span to track timing of brillig gen (#5835)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* Small change which adds tracking for how long brillig gen takes to the debug logs. ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[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.
1 parent 88f7858 commit 9e5208d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/noirc_evaluator/src/brillig/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl std::ops::Index<FunctionId> for Brillig {
5858

5959
impl Ssa {
6060
/// Compile to brillig brillig functions and ACIR functions reachable from them
61+
#[tracing::instrument(level = "trace", skip_all)]
6162
pub(crate) fn to_brillig(&self, enable_debug_trace: bool) -> Brillig {
6263
// Collect all the function ids that are reachable from brillig
6364
// That means all the functions marked as brillig and ACIR functions called by them

compiler/noirc_evaluator/src/ssa.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,13 @@ pub(crate) fn optimize_into_acir(
127127
ssa.check_for_underconstrained_values()
128128
})
129129
};
130+
131+
drop(ssa_gen_span_guard);
132+
130133
let brillig = time("SSA to Brillig", options.print_codegen_timings, || {
131134
ssa.to_brillig(options.enable_brillig_logging)
132135
});
133136

134-
drop(ssa_gen_span_guard);
135-
136137
let artifacts = time("SSA to ACIR", options.print_codegen_timings, || {
137138
ssa.into_acir(&brillig, options.expression_width)
138139
})?;

0 commit comments

Comments
 (0)