Skip to content
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

[chore] Strip debug_info when not collecting metrics #865

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions toolchain/instructions/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ impl<F: Field> Program<F> {
}
}

pub fn strip_debug_infos(self) -> Self {
Self {
instructions_and_debug_infos: self
.instructions_and_debug_infos
.into_iter()
.map(|opt| opt.map(|(ins, _)| (ins, None)))
.collect(),
..self
}
}

pub fn from_instructions(instructions: &[Instruction<F>]) -> Self {
Self::new_without_debug_infos(
instructions,
Expand Down
5 changes: 5 additions & 0 deletions vm/src/arch/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ impl<F: PrimeField32> ExecutionSegment<F> {
) -> Self {
let mut chip_set = config.create_chip_set();
chip_set.set_streams(streams);
let program = if config.collect_metrics {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update new_segment as well?

program
} else {
program.strip_debug_infos()
};
chip_set.set_program(program);

if let Some(initial_memory) = initial_memory {
Expand Down
Loading