From 4ce94ce4556c7c56501967770fb58e3b67532cc3 Mon Sep 17 00:00:00 2001 From: Georg Wiese Date: Fri, 15 Dec 2023 12:08:56 +0100 Subject: [PATCH] VmProcessor: Reduce logging frequency --- executor/src/witgen/vm_processor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/executor/src/witgen/vm_processor.rs b/executor/src/witgen/vm_processor.rs index 26800f88f..f171d096a 100644 --- a/executor/src/witgen/vm_processor.rs +++ b/executor/src/witgen/vm_processor.rs @@ -53,6 +53,7 @@ pub struct VmProcessor<'a, 'b, 'c, T: FieldElement, Q: QueryCallback> { /// (precomputed once for performance reasons) identities_without_next_ref: Vec<&'a Identity>>, last_report: DegreeType, + report_frequency: DegreeType, last_report_time: Instant, row_factory: RowFactory<'a, T>, processor: Processor<'a, 'b, 'c, T, Q>, @@ -73,6 +74,8 @@ impl<'a, 'b, 'c, T: FieldElement, Q: QueryCallback> VmProcessor<'a, 'b, 'c, T .partition(|identity| identity.contains_next_ref()); let processor = Processor::new(row_offset, data, mutable_state, fixed_data, witnesses); + let report_frequency = max(fixed_data.degree / 10, 1000); + VmProcessor { row_offset, witnesses: witnesses.clone(), @@ -81,6 +84,7 @@ impl<'a, 'b, 'c, T: FieldElement, Q: QueryCallback> VmProcessor<'a, 'b, 'c, T identities_without_next_ref: identities_without_next, row_factory, last_report: 0, + report_frequency, last_report_time: Instant::now(), processor, } @@ -462,7 +466,7 @@ impl<'a, 'b, 'c, T: FieldElement, Q: QueryCallback> VmProcessor<'a, 'b, 'c, T } fn maybe_log_performance(&mut self, row_index: DegreeType) { - if row_index >= self.last_report + 1000 { + if row_index >= self.last_report + self.report_frequency { let duration = self.last_report_time.elapsed(); self.last_report_time = Instant::now();