-
Notifications
You must be signed in to change notification settings - Fork 70
starknet_committer,apollo_committer: add timers for fetch patricia paths #14189
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
base: ariel/read_paths_and_commit_block
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,10 @@ pub enum Action { | |
| Read, | ||
| Compute, | ||
| Write, | ||
| #[cfg(feature = "os_input")] | ||
| FetchWitnessesFirstPass, | ||
| #[cfg(feature = "os_input")] | ||
| FetchWitnessesSecondPass, | ||
| } | ||
|
|
||
| #[derive(Default)] | ||
|
|
@@ -19,6 +23,10 @@ pub struct BlockTimers { | |
| pub read_timer: Option<Instant>, | ||
| pub compute_timer: Option<Instant>, | ||
| pub writer_timer: Option<Instant>, | ||
| #[cfg(feature = "os_input")] | ||
| pub fetch_witnesses_first_pass_timer: Option<Instant>, | ||
| #[cfg(feature = "os_input")] | ||
| pub fetch_witnesses_second_pass_timer: Option<Instant>, | ||
| } | ||
|
|
||
| impl BlockTimers { | ||
|
|
@@ -28,6 +36,10 @@ impl BlockTimers { | |
| Action::Read => &mut self.read_timer, | ||
| Action::Compute => &mut self.compute_timer, | ||
| Action::Write => &mut self.writer_timer, | ||
| #[cfg(feature = "os_input")] | ||
| Action::FetchWitnessesFirstPass => &mut self.fetch_witnesses_first_pass_timer, | ||
| #[cfg(feature = "os_input")] | ||
| Action::FetchWitnessesSecondPass => &mut self.fetch_witnesses_second_pass_timer, | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -91,6 +103,12 @@ pub struct BlockDurations { | |
| pub read: f64, // Duration of a read phase (seconds). | ||
| pub compute: f64, // Duration of a computation phase (seconds). | ||
| pub write: f64, // Duration of a write phase (seconds). | ||
| #[cfg(feature = "os_input")] | ||
| // Duration of fetching witnesses w.r.t the old root (seconds). | ||
| pub fetch_witnesses_first_pass: f64, | ||
| #[cfg(feature = "os_input")] | ||
| // Duration of fetching witnesses w.r.t the new root (seconds). | ||
| pub fetch_witnesses_second_pass: f64, | ||
| } | ||
|
|
||
| #[derive(Default, Clone, Debug, PartialEq, Eq)] | ||
|
|
@@ -113,6 +131,9 @@ pub struct BlockMeasurement { | |
| pub n_reads: usize, | ||
| pub durations: BlockDurations, | ||
| pub modifications_counts: BlockModificationsCounts, | ||
| #[cfg(feature = "os_input")] | ||
| // Number of witnesses fetched in the first pass (pre-commit). | ||
| pub fetched_witnesses_count: usize, | ||
| } | ||
|
|
||
| impl BlockMeasurement { | ||
|
|
@@ -137,6 +158,15 @@ impl BlockMeasurement { | |
| Action::EndToEnd => { | ||
| self.durations.block = duration_in_seconds; | ||
| } | ||
| #[cfg(feature = "os_input")] | ||
| Action::FetchWitnessesFirstPass => { | ||
| self.durations.fetch_witnesses_first_pass = duration_in_seconds; | ||
| self.fetched_witnesses_count += entries_count; | ||
| } | ||
| #[cfg(feature = "os_input")] | ||
| Action::FetchWitnessesSecondPass => { | ||
| self.durations.fetch_witnesses_second_pass = duration_in_seconds; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Second pass witness count silently discarded in measurementLow Severity The Additional Locations (1)Reviewed by Cursor Bugbot for commit fdd5e5d. Configure here. |
||
| } | ||
| } | ||
| } | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.