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

[IGNORE] Performance test #14738

Closed
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions aptos-move/aptos-vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ move-vm-types = { workspace = true }
num_cpus = { workspace = true }
once_cell = { workspace = true }
ouroboros = { workspace = true }
parking_lot = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
Expand Down
23 changes: 22 additions & 1 deletion aptos-move/aptos-vm/src/block_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
};
use move_vm_types::delayed_values::delayed_field_id::DelayedFieldID;
use once_cell::sync::{Lazy, OnceCell};
use parking_lot::RwLock;
use rayon::ThreadPool;
use std::{
collections::{BTreeMap, HashSet},
Expand Down Expand Up @@ -380,6 +381,26 @@
}
}

// TODO(loader_v2): Only for TPS testing, no env update and no limits on cached names/types.
static ENV: Lazy<RwLock<Option<AptosEnvironment>>> = Lazy::new(|| RwLock::new(None));

Check warning on line 385 in aptos-move/aptos-vm/src/block_executor/mod.rs

View check run for this annotation

Codecov / codecov/patch

aptos-move/aptos-vm/src/block_executor/mod.rs#L385

Added line #L385 was not covered by tests

fn get_or_create_environment(state_view: &impl StateView) -> AptosEnvironment {
if let Some(env) = &*ENV.read() {
return env.clone();
}

let mut maybe_env = ENV.write();
if let Some(env) = &*maybe_env {
return env.clone();
}

let env = AptosEnvironment::new_with_delayed_field_optimization_enabled(state_view);
*maybe_env = Some(env.clone());
drop(maybe_env);

env
}

Check warning on line 402 in aptos-move/aptos-vm/src/block_executor/mod.rs

View check run for this annotation

Codecov / codecov/patch

aptos-move/aptos-vm/src/block_executor/mod.rs#L387-L402

Added lines #L387 - L402 were not covered by tests

pub struct BlockAptosVM;

impl BlockAptosVM {
Expand Down Expand Up @@ -410,7 +431,7 @@
ExecutableTestType,
>::new(config, executor_thread_pool, transaction_commit_listener);

let environment = AptosEnvironment::new_with_delayed_field_optimization_enabled(state_view);
let environment = get_or_create_environment(state_view);

Check warning on line 434 in aptos-move/aptos-vm/src/block_executor/mod.rs

View check run for this annotation

Codecov / codecov/patch

aptos-move/aptos-vm/src/block_executor/mod.rs#L434

Added line #L434 was not covered by tests
let ret = executor.execute_block(environment, signature_verified_block, state_view);
match ret {
Ok(block_output) => {
Expand Down
Loading
Loading