Skip to content

Commit

Permalink
Skip log_kernel_instruction if debug logs disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubarov committed Feb 17, 2023
1 parent f3946f7 commit 745bec8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion evm/src/witness/transition.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use itertools::Itertools;
use log::log_enabled;
use plonky2::field::types::Field;

use crate::cpu::columns::CpuColumnsView;
Expand Down Expand Up @@ -257,8 +258,12 @@ fn try_perform_instruction<F: Field>(state: &mut GenerationState<F>) -> Result<(
}

fn log_kernel_instruction<F: Field>(state: &mut GenerationState<F>, op: Operation) {
// The logic below is a bit costly, so skip it if debug logs aren't enabled.
if !log_enabled!(log::Level::Debug) {
return;
}

let pc = state.registers.program_counter;
// TODO: This is affecting performance...
let is_interesting_offset = KERNEL
.offset_label(pc)
.filter(|label| !label.starts_with("halt_pc"))
Expand Down

0 comments on commit 745bec8

Please sign in to comment.