Skip to content

Commit

Permalink
Create benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
runtian-zhou committed Jan 9, 2025
1 parent c2b5b99 commit dceaa7d
Show file tree
Hide file tree
Showing 5 changed files with 1,740 additions and 1,699 deletions.
2 changes: 2 additions & 0 deletions aptos-move/e2e-benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ fn main() {
// move_len: 10,
// repeats: 1000,
// },
EntryPoints::APTPermissionedTransfer,
EntryPoints::APTTransfer,
];

let mut failures = Vec::new();
Expand Down
6 changes: 6 additions & 0 deletions crates/transaction-generator-lib/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ pub enum TransactionTypeArg {
SmartTablePicture1MWith1KChangeExceedsLimit,
DeserializeU256,
SimpleScript,
PermissionedTransfer,
APTTransfer,
}

impl TransactionTypeArg {
Expand Down Expand Up @@ -344,6 +346,10 @@ impl TransactionTypeArg {
},
TransactionTypeArg::DeserializeU256 => call_custom_module(EntryPoints::DeserializeU256),
TransactionTypeArg::SimpleScript => call_custom_module(EntryPoints::SimpleScript),
TransactionTypeArg::PermissionedTransfer => {
call_custom_module(EntryPoints::APTPermissionedTransfer)
},
TransactionTypeArg::APTTransfer => call_custom_module(EntryPoints::APTTransfer),
}
}

Expand Down
26 changes: 25 additions & 1 deletion crates/transaction-generator-lib/src/publishing/module_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ pub enum EntryPoints {
/// there to slow down deserialization & verification, effectively making it more expensive to
/// load it into code cache.
SimpleScript,
APTPermissionedTransfer,
APTTransfer,
}

impl EntryPoints {
Expand Down Expand Up @@ -340,7 +342,9 @@ impl EntryPoints {
| EntryPoints::ResourceGroupsSenderWriteTag { .. }
| EntryPoints::ResourceGroupsSenderMultiChange { .. }
| EntryPoints::CoinInitAndMint
| EntryPoints::FungibleAssetMint => "framework_usecases",
| EntryPoints::FungibleAssetMint
| EntryPoints::APTPermissionedTransfer
| EntryPoints::APTTransfer => "framework_usecases",
EntryPoints::TokenV2AmbassadorMint { .. } | EntryPoints::TokenV2AmbassadorBurn => {
"ambassador_token"
},
Expand Down Expand Up @@ -418,6 +422,9 @@ impl EntryPoints {
EntryPoints::IncGlobalMilestoneAggV2 { .. }
| EntryPoints::CreateGlobalMilestoneAggV2 { .. } => "counter_with_milestone",
EntryPoints::DeserializeU256 => "bcs_stream",
EntryPoints::APTPermissionedTransfer | EntryPoints::APTTransfer => {
"permissioned_transfer"
},
}
}

Expand Down Expand Up @@ -815,6 +822,20 @@ impl EntryPoints {
],
)
},
EntryPoints::APTPermissionedTransfer => get_payload(
module_id,
ident_str!("transfer_permissioned").to_owned(),
vec![
bcs::to_bytes(&other.expect("Must provide other")).unwrap(),
bcs::to_bytes(&1u64).unwrap(),
],
),
EntryPoints::APTTransfer => {
get_payload(module_id, ident_str!("transfer").to_owned(), vec![
bcs::to_bytes(&other.expect("Must provide other")).unwrap(),
bcs::to_bytes(&1u64).unwrap(),
])
},
}
}

Expand Down Expand Up @@ -928,6 +949,9 @@ impl EntryPoints {
EntryPoints::DeserializeU256 => AutomaticArgs::None,
EntryPoints::IncGlobalMilestoneAggV2 { .. } => AutomaticArgs::None,
EntryPoints::CreateGlobalMilestoneAggV2 { .. } => AutomaticArgs::Signer,
EntryPoints::APTPermissionedTransfer | EntryPoints::APTTransfer => {
AutomaticArgs::Signer
},
}
}
}
Expand Down
Loading

0 comments on commit dceaa7d

Please sign in to comment.