Skip to content

Commit 46e06f4

Browse files
authored
Merge pull request #2630 from ljedrz/perf/remove_redundant_arc
[Perf] Remove a redundant Arc
2 parents 8213f6b + b62b4b8 commit 46e06f4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

synthesizer/process/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ use colored::Colorize;
7878
#[derive(Clone)]
7979
pub struct Process<N: Network> {
8080
/// The universal SRS.
81-
universal_srs: Arc<UniversalSRS<N>>,
81+
universal_srs: UniversalSRS<N>,
8282
/// The mapping of program IDs to stacks.
8383
stacks: IndexMap<ProgramID<N>, Arc<Stack<N>>>,
8484
}
@@ -90,7 +90,7 @@ impl<N: Network> Process<N> {
9090
let timer = timer!("Process:setup");
9191

9292
// Initialize the process.
93-
let mut process = Self { universal_srs: Arc::new(UniversalSRS::load()?), stacks: IndexMap::new() };
93+
let mut process = Self { universal_srs: UniversalSRS::load()?, stacks: IndexMap::new() };
9494
lap!(timer, "Initialize process");
9595

9696
// Initialize the 'credits.aleo' program.
@@ -145,7 +145,7 @@ impl<N: Network> Process<N> {
145145
let timer = timer!("Process::load");
146146

147147
// Initialize the process.
148-
let mut process = Self { universal_srs: Arc::new(UniversalSRS::load()?), stacks: IndexMap::new() };
148+
let mut process = Self { universal_srs: UniversalSRS::load()?, stacks: IndexMap::new() };
149149
lap!(timer, "Initialize process");
150150

151151
// Initialize the 'credits.aleo' program.
@@ -183,7 +183,7 @@ impl<N: Network> Process<N> {
183183
#[cfg(feature = "wasm")]
184184
pub fn load_web() -> Result<Self> {
185185
// Initialize the process.
186-
let mut process = Self { universal_srs: Arc::new(UniversalSRS::load()?), stacks: IndexMap::new() };
186+
let mut process = Self { universal_srs: UniversalSRS::load()?, stacks: IndexMap::new() };
187187

188188
// Initialize the 'credits.aleo' program.
189189
let program = Program::credits()?;
@@ -200,7 +200,7 @@ impl<N: Network> Process<N> {
200200

201201
/// Returns the universal SRS.
202202
#[inline]
203-
pub const fn universal_srs(&self) -> &Arc<UniversalSRS<N>> {
203+
pub const fn universal_srs(&self) -> &UniversalSRS<N> {
204204
&self.universal_srs
205205
}
206206

synthesizer/process/src/stack/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pub struct Stack<N: Network> {
182182
/// The mapping of finalize names to their register types.
183183
finalize_types: IndexMap<Identifier<N>, FinalizeTypes<N>>,
184184
/// The universal SRS.
185-
universal_srs: Arc<UniversalSRS<N>>,
185+
universal_srs: UniversalSRS<N>,
186186
/// The mapping of function name to proving key.
187187
proving_keys: Arc<RwLock<IndexMap<Identifier<N>, ProvingKey<N>>>>,
188188
/// The mapping of function name to verifying key.

synthesizer/process/src/tests/test_execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ fn test_process_deploy_credits_program() {
23652365

23662366
// Initialize an empty process without the `credits` program.
23672367
let empty_process =
2368-
Process { universal_srs: Arc::new(UniversalSRS::<CurrentNetwork>::load().unwrap()), stacks: IndexMap::new() };
2368+
Process { universal_srs: UniversalSRS::<CurrentNetwork>::load().unwrap(), stacks: IndexMap::new() };
23692369

23702370
// Construct the process.
23712371
let process = Process::load().unwrap();

0 commit comments

Comments
 (0)