Skip to content

Commit

Permalink
fix(profiler): Correctly compute clock frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Jun 13, 2024
1 parent e53402e commit e1281b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions triton-vm/src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,19 +589,19 @@ impl Display for VMPerformanceProfile {

writeln!(f)?;
if let Some(cycles) = self.cycle_count {
let frequency = 1_000 * cycles / total_time / num_iters;
let frequency = 1_000 * num_iters * cycles / total_time;
write!(f, "Clock frequency is {frequency} Hz ")?;
write!(f, "({cycles} clock cycles ")?;
write!(f, "/ {total_time} ms ")?;
writeln!(f, "/ {num_iters} iterations)")?;
write!(f, "/ ({total_time} ms ")?;
writeln!(f, "/ {num_iters} iterations))")?;
}

if let Some(height) = self.padded_height {
let frequency = 1_000 * height / total_time / num_iters;
let frequency = 1_000 * num_iters * height / total_time;
write!(f, "Optimal clock frequency is {frequency} Hz ")?;
write!(f, "({height} padded height ")?;
write!(f, "/ {total_time} ms ")?;
writeln!(f, "/ {num_iters} iterations)")?;
write!(f, "/ ({total_time} ms ")?;
writeln!(f, "/ {num_iters} iterations))")?;
}

if let Some(fri_domain_length) = self.fri_domain_len {
Expand Down

0 comments on commit e1281b0

Please sign in to comment.