Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Parallel executor benchmark to master (#3958)
* [benchmark] bencher for parallel executor

(cherry picked from commit 8619709)

* [e2e-test] Commit e2etest first

(cherry picked from commit dfb2588)

* [e2e-test] Format codes

(cherry picked from commit a32fe9f)

* [e2e-test] add some change for e2e-test

(cherry picked from commit d280d71)

* [e2e-test] fixed all compiling error

(cherry picked from commit 491d14d)

* [e2e-test] fixed cargo clippy check

(cherry picked from commit 586c1d0)

* [e2e-test] Fixed build error

(cherry picked from commit 913de29)

* [e2e-test] Fixed for data_store

(cherry picked from commit 563af3f)

* [e2e-test] Fixed for trasnction peer to peer bench mark

(cherry picked from commit c9e2d72)

* [e2e-test] Fixed for trasnction peer to peer bench mark

(cherry picked from commit 361976a)

* [e2e-test] Fix commit checking

(cherry picked from commit ff77776)

* [e2e-test] Use CPU numbers for concurrency level

(cherry picked from commit be839e1)

* [e2e-test] abort Token name is "Token"

(cherry picked from commit 304748c)

* [e2e-test] put the transaction count to parameter for transaction benches.

(cherry picked from commit caee3bd)

* [e2e-test] add the bench script

(cherry picked from commit a9e09c7)

* [e2e-test] commit for fmt

(cherry picked from commit 9fbbad5)

* [e2e-test] fixed for the skip rest transaction test

(cherry picked from commit de8b478)

* [benchmark] fix cargo fmt

* [benchmark] fix cargo fmt

* [benchmark] fix cargo clippy errors

* [benchmark] fix cargo fmt check
  • Loading branch information
welbon committed Aug 29, 2023
1 parent ef27ca5 commit 57a0415
Show file tree
Hide file tree
Showing 198 changed files with 6,487 additions and 58 deletions.
131 changes: 126 additions & 5 deletions Cargo.lock

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

12 changes: 10 additions & 2 deletions Cargo.toml
Expand Up @@ -87,6 +87,10 @@ members = [
"vm/move-package-manager",
"vm/vm-status-translator",
"vm/starcoin-transactional-test-harness",
"vm/parallel-executor",
"vm/transaction-benchmarks",
"vm/e2e-tests",
"vm/proptest-helpers",
"abi/types",
"abi/decoder",
"abi/resolver",
Expand Down Expand Up @@ -434,7 +438,7 @@ starcoin-chain-service = { path = "chain/service" }
starcoin-cmd = { path = "cmd/starcoin" }
starcoin-config = { path = "config" }
starcoin-consensus = { path = "consensus" }
starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev = "a02de6d0b83abe0abff088683e891df0238102fe" }
starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev = "a742ddc0674022800341182cbb4c3681807b2f00" }
starcoin-decrypt = { path = "commons/decrypt" }
starcoin-dev = { path = "vm/dev" }
starcoin-executor = { path = "executor" }
Expand Down Expand Up @@ -487,8 +491,12 @@ stest = { path = "commons/stest" }
stest-macro = { path = "commons/stest/stest-macro" }
stream-task = { path = "commons/stream-task" }
starcoin-mvhashmap = { path = "vm/mvhashmap" }
starcoin-parallel-executor = { path = "vm/parallel-executor" }
starcoin-infallible = { path = "commons/infallible" }
starcoin-parallel-executor = { path = "vm/parallel-executor" }
starcoin-transaction-benchmarks = { path = "vm/transaction-benchmarks" }
starcoin-language-e2e-tests = { path = "vm/e2e-tests" }
starcoin-proptest-helpers = { path = "vm/proptest-helpers" }

syn = { version = "1.0.107", features = [
"full",
"extra-traits",
Expand Down
51 changes: 26 additions & 25 deletions benchmarks/Cargo.toml
@@ -1,18 +1,14 @@
[[bench]]
harness = false
name = "bench_storage"

[[bench]]
harness = false
name = "bench_chain"

[[bench]]
harness = false
name = "bench_state_tree"
[package]
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "benchmarks"
publish = { workspace = true }
version = "1.13.7"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }

[[bench]]
harness = false
name = "bench_vm"

[dependencies]
anyhow = { workspace = true }
Expand Down Expand Up @@ -49,16 +45,21 @@ starcoin-executor-benchmark = { workspace = true }
[lib]
bench = false

[package]
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "benchmarks"
publish = { workspace = true }
version = "1.13.7"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
[[bench]]
harness = false
name = "bench_storage"

[[bench]]
harness = false
name = "bench_chain"

[[bench]]
harness = false
name = "bench_state_tree"

[[bench]]
harness = false
name = "bench_vm"

[target."cfg(target_os=\"linux\")".dependencies]
pprof = { version = "0.10", features = ["flamegraph", "criterion"] }
pprof = { version = "0.10", features = ["flamegraph", "criterion"] }
2 changes: 1 addition & 1 deletion cmd/starcoin/src/account/submit_txn_cmd.rs
Expand Up @@ -12,7 +12,7 @@ use crate::view::{ExecutionOutputView, FilePathOrHex};
use crate::StarcoinOpt;

#[derive(Debug, Parser)]
/// Submit a SignedTransaction file or hex to transaction pool.
/// Submit a SignedUserTransaction file or hex to transaction pool.
#[clap(name = "submit-txn", alias = "submit-multisig-txn")]
pub struct SubmitTxnOpt {
#[clap(name = "signed-txn-file-or-hex", required = true)]
Expand Down
1 change: 1 addition & 0 deletions node/Cargo.toml
Expand Up @@ -47,6 +47,7 @@ starcoin-vm-runtime = { workspace = true }
thiserror = { workspace = true }
timeout-join-handler = { workspace = true }
tokio = { features = ["full"], workspace = true }
num_cpus = { workspace = true }

[dev-dependencies]
stest = { workspace = true }
Expand Down
7 changes: 4 additions & 3 deletions node/src/node.rs
Expand Up @@ -12,6 +12,7 @@ use futures::channel::oneshot;
use futures::executor::block_on;
use futures_timer::Delay;
use network_api::{PeerProvider, PeerSelector, PeerStrategy};
use num_cpus;
use starcoin_account_service::{AccountEventService, AccountService, AccountStorage};
use starcoin_block_relayer::BlockRelayer;
use starcoin_chain_notify::ChainNotifyHandlerService;
Expand Down Expand Up @@ -54,7 +55,7 @@ use starcoin_sync::verified_rpc_client::VerifiedRpcClient;
use starcoin_txpool::TxPoolActorService;
use starcoin_types::system_events::{SystemShutdown, SystemStarted};
use starcoin_vm_runtime::metrics::VMMetrics;
// use starcoin_vm_runtime::starcoin_vm::StarcoinVM;
use starcoin_vm_runtime::starcoin_vm::StarcoinVM;
use std::sync::Arc;
use std::time::{Duration, SystemTime};

Expand Down Expand Up @@ -233,8 +234,8 @@ impl NodeService {
logger_handle.enable_stderr();
}

// XXX FIXME YSG add execute_config, currently we use console command to test
// StarcoinVM::set_concurrency_level_once(num_cpus::get());
// XXX FIXME YSG add execute_config
StarcoinVM::set_concurrency_level_once(num_cpus::get());
let (start_sender, start_receiver) = oneshot::channel();
let join_handle = timeout_join_handler::spawn(move || {
let system = System::with_tokio_rt(|| {
Expand Down
2 changes: 2 additions & 0 deletions scripts/benchmark_parallel.sh
@@ -0,0 +1,2 @@
RUST_LOG=info cargo bench --features fuzzing -p 'starcoin-parallel-executor'
RUST_LOG=info cargo bench --features fuzzing -p 'starcoin-transaction-benchmarks'

0 comments on commit 57a0415

Please sign in to comment.