Skip to content

Commit 2796704

Browse files
authored
chore: Remove send + sync bound on executor (#2156)
It is not required after a small refactor.
1 parent 8141dac commit 2796704

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

crates/vm/src/arch/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ where
7272
}
7373

7474
pub trait VmExecutionConfig<F> {
75-
type Executor: AnyEnum + Send + Sync;
75+
type Executor: AnyEnum;
7676

7777
fn create_executors(&self)
7878
-> Result<ExecutorInventory<Self::Executor>, ExecutorInventoryError>;

crates/vm/src/arch/interpreter_preflight.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::{iter::repeat_n, sync::Arc};
22

3+
#[cfg(not(feature = "parallel"))]
4+
use itertools::Itertools;
35
use openvm_instructions::{instruction::Instruction, program::Program, LocalOpcode, SystemOpcode};
46
use openvm_stark_backend::{
57
p3_field::{Field, PrimeField32},
@@ -101,17 +103,13 @@ impl<F: Field, E> PreflightInterpretedInstance<F, E> {
101103
&self.inventory.executors
102104
}
103105

104-
pub fn filtered_execution_frequencies(&self) -> Vec<u32>
105-
where
106-
E: Send + Sync,
107-
{
106+
pub fn filtered_execution_frequencies(&self) -> Vec<u32> {
108107
let base_idx = get_pc_index(self.pc_base);
109108
self.pc_handler
110109
.par_iter()
111-
.enumerate()
110+
.zip_eq(&self.execution_frequencies)
112111
.skip(base_idx)
113-
.filter(|(_, entry)| entry.is_some())
114-
.map(|(i, _)| self.execution_frequencies[i])
112+
.filter_map(|(entry, freq)| entry.is_some().then_some(*freq))
115113
.collect()
116114
}
117115

0 commit comments

Comments
 (0)