From 8d925ce9b45e076c85211742032b44d5c9f3127f Mon Sep 17 00:00:00 2001 From: Gregory Sobol Date: Thu, 21 Dec 2023 12:22:15 +0100 Subject: [PATCH] remove redundant --- common/src/benchmarking.rs | 23 +------------ pallets/gear/src/benchmarking/mod.rs | 46 +++++-------------------- pallets/gear/src/benchmarking/tasks.rs | 2 +- pallets/gear/src/weights.rs | 44 +---------------------- runtime/vara/src/weights/pallet_gear.rs | 44 +---------------------- 5 files changed, 12 insertions(+), 147 deletions(-) diff --git a/common/src/benchmarking.rs b/common/src/benchmarking.rs index 9d9cd19902a..e5c893be349 100644 --- a/common/src/benchmarking.rs +++ b/common/src/benchmarking.rs @@ -25,7 +25,6 @@ use gear_core::{ use gear_wasm_instrument::parity_wasm::{self, elements::*}; use sp_io::hashing::blake2_256; use sp_runtime::traits::Zero; -use sp_std::borrow::ToOwned; pub fn account(name: &'static str, index: u32, seed: u32) -> AccountId { let entropy = (name, index, seed).using_encoded(blake2_256); @@ -61,13 +60,6 @@ pub fn create_module(num_pages: WasmPage) -> parity_wasm::elements::Module { ]) } -pub fn generate_wasm(num_pages: WasmPage) -> Result, &'static str> { - let module = create_module(num_pages); - let code = parity_wasm::serialize(module).map_err(|_| "Failed to serialize module")?; - - Ok(code) -} - // A wasm module that allocates `$num_pages` in `handle` function: // (module // (import "env" "memory" (memory 1)) @@ -80,7 +72,7 @@ pub fn generate_wasm(num_pages: WasmPage) -> Result, &'static str> { // (local.set $result (call $alloc (i32.const $num_pages))) // ) // ) -pub fn generate_wasm2(num_pages: WasmPage) -> Result, &'static str> { +pub fn generate_wasm(num_pages: WasmPage) -> Result, &'static str> { let module = parity_wasm::elements::Module::new(vec![ Section::Type(TypeSection::with_types(vec![ Type::Function(FunctionType::new( @@ -123,19 +115,6 @@ pub fn generate_wasm2(num_pages: WasmPage) -> Result, &'static str> { Ok(code) } -pub fn generate_wasm3(payload: Vec) -> Result, &'static str> { - let mut module = create_module(1.into()); - module - .insert_section(Section::Custom(CustomSection::new( - "zeroed_section".to_owned(), - payload, - ))) - .unwrap(); - let code = parity_wasm::serialize(module).map_err(|_| "Failed to serialize module")?; - - Ok(code) -} - pub fn set_program< ProgramStorage: super::ProgramStorage, BlockNumber: Zero + Copy + Saturating, diff --git a/pallets/gear/src/benchmarking/mod.rs b/pallets/gear/src/benchmarking/mod.rs index dc640bb61c4..ce0c2151351 100644 --- a/pallets/gear/src/benchmarking/mod.rs +++ b/pallets/gear/src/benchmarking/mod.rs @@ -468,7 +468,7 @@ benchmarks! { CurrencyOf::::deposit_creating(&caller, 100_000_000_000_000_u128.unique_saturated_into()); let program_id = benchmarking::account::("program", 0, 100); CurrencyOf::::deposit_creating(&program_id, 100_000_000_000_000_u128.unique_saturated_into()); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); benchmarking::set_program::, _>(program_id.clone().cast(), code, 1.into()); let original_message_id = benchmarking::account::("message", 0, 100).cast(); let gas_limit = 50000; @@ -499,7 +499,7 @@ benchmarks! { let caller = benchmarking::account("caller", 0, 0); CurrencyOf::::deposit_creating(&caller, 200_000_000_000_000u128.unique_saturated_into()); let minimum_balance = CurrencyOf::::minimum_balance(); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); let salt = vec![]; let program_id = ProgramId::generate_from_user(CodeId::generate(&code), &salt); Gear::::upload_program(RawOrigin::Signed(caller.clone()).into(), code, salt, b"init_payload".to_vec(), 10_000_000_000, 0u32.into(), false).expect("submit program failed"); @@ -519,7 +519,7 @@ benchmarks! { resume_session_init { let caller = benchmarking::account("caller", 0, 0); CurrencyOf::::deposit_creating(&caller, 200_000_000_000_000u128.unique_saturated_into()); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); let salt = vec![]; let program_id = ProgramId::generate_from_user(CodeId::generate(&code), &salt); Gear::::upload_program(RawOrigin::Signed(caller.clone()).into(), code, salt, b"init_payload".to_vec(), 10_000_000_000, 0u32.into(), false).expect("submit program failed"); @@ -544,7 +544,7 @@ benchmarks! { let c in 0 .. 16 * (WASM_PAGE_SIZE / GEAR_PAGE_SIZE) as u32; let caller = benchmarking::account("caller", 0, 0); CurrencyOf::::deposit_creating(&caller, 200_000_000_000_000u128.unique_saturated_into()); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); let salt = vec![]; let program_id = ProgramId::generate_from_user(CodeId::generate(&code), &salt); Gear::::upload_program(RawOrigin::Signed(caller.clone()).into(), code, salt, b"init_payload".to_vec(), 10_000_000_000, 0u32.into(), false,).expect("submit program failed"); @@ -580,7 +580,7 @@ benchmarks! { let c in 0 .. (MAX_PAGES - 1) * (WASM_PAGE_SIZE / GEAR_PAGE_SIZE) as u32; let caller = benchmarking::account("caller", 0, 0); CurrencyOf::::deposit_creating(&caller, 400_000_000_000_000u128.unique_saturated_into()); - let code = benchmarking::generate_wasm2(0.into()).unwrap(); + let code = benchmarking::generate_wasm(0.into()).unwrap(); let salt = vec![]; let program_id = ProgramId::generate_from_user(CodeId::generate(&code), &salt); Gear::::upload_program(RawOrigin::Signed(caller.clone()).into(), code, salt, b"init_payload".to_vec(), 10_000_000_000, 0u32.into(), false,).expect("submit program failed"); @@ -696,7 +696,7 @@ benchmarks! { CurrencyOf::::deposit_creating(&caller, 100_000_000_000_000_u128.unique_saturated_into()); let minimum_balance = CurrencyOf::::minimum_balance(); let program_id = benchmarking::account::("program", 0, 100).cast(); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); benchmarking::set_program::, _>(program_id, code, 1.into()); let payload = vec![0_u8; p as usize]; @@ -713,7 +713,7 @@ benchmarks! { let minimum_balance = CurrencyOf::::minimum_balance(); let program_id = benchmarking::account::("program", 0, 100); CurrencyOf::::deposit_creating(&program_id, 100_000_000_000_000_u128.unique_saturated_into()); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); benchmarking::set_program::, _>(program_id.clone().cast(), code, 1.into()); let original_message_id = benchmarking::account::("message", 0, 100).cast(); let gas_limit = 50000; @@ -739,36 +739,6 @@ benchmarks! { assert!(MailboxOf::::is_empty(&caller)) } - initial_allocation { - let q in 1 .. MAX_PAGES; - let q = q as u16; - let caller: T::AccountId = benchmarking::account("caller", 0, 0); - CurrencyOf::::deposit_creating(&caller, (1u128 << 60).unique_saturated_into()); - let code = benchmarking::generate_wasm(q.into()).unwrap(); - let salt = vec![255u8; 32]; - }: { - let _ = Gear::::upload_program(RawOrigin::Signed(caller).into(), code, salt, vec![], 100_000_000u64, 0u32.into(), false,); - process_queue::(); - } - verify { - assert!(matches!(QueueOf::::dequeue(), Ok(None))); - } - - alloc_in_handle { - let q in 0 .. MAX_PAGES; - let q = q as u16; - let caller: T::AccountId = benchmarking::account("caller", 0, 0); - CurrencyOf::::deposit_creating(&caller, (1_u128 << 60).unique_saturated_into()); - let code = benchmarking::generate_wasm2(q.into()).unwrap(); - let salt = vec![255u8; 32]; - }: { - let _ = Gear::::upload_program(RawOrigin::Signed(caller).into(), code, salt, vec![], 100_000_000u64, 0u32.into(), false,); - process_queue::(); - } - verify { - assert!(matches!(QueueOf::::dequeue(), Ok(None))); - } - // This benchmarks the additional weight that is charged when a program is executed the // first time after a new schedule was deployed: For every new schedule a program needs // to re-run the instrumentation once. @@ -2857,7 +2827,7 @@ benchmarks! { tasks_pause_program { let c in 0 .. (MAX_PAGES - 1) * (WASM_PAGE_SIZE / GEAR_PAGE_SIZE) as u32; - let code = benchmarking::generate_wasm2(0.into()).unwrap(); + let code = benchmarking::generate_wasm(0.into()).unwrap(); let program_id = tasks::pause_program_prepare::(c, code); let mut ext_manager = ExtManager::::default(); diff --git a/pallets/gear/src/benchmarking/tasks.rs b/pallets/gear/src/benchmarking/tasks.rs index a7987fb9412..647d376565b 100644 --- a/pallets/gear/src/benchmarking/tasks.rs +++ b/pallets/gear/src/benchmarking/tasks.rs @@ -106,7 +106,7 @@ where { let caller = benchmarking::account("caller", 0, 0); CurrencyOf::::deposit_creating(&caller, 200_000_000_000_000u128.unique_saturated_into()); - let code = benchmarking::generate_wasm2(16.into()).unwrap(); + let code = benchmarking::generate_wasm(16.into()).unwrap(); let salt = vec![]; let program_id = ProgramId::generate_from_user(CodeId::generate(&code), &salt); Gear::::upload_program( diff --git a/pallets/gear/src/weights.rs b/pallets/gear/src/weights.rs index b0695a26165..085fe245df4 100644 --- a/pallets/gear/src/weights.rs +++ b/pallets/gear/src/weights.rs @@ -25,7 +25,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("vara-dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/gear benchmark pallet --chain=vara-dev --steps=50 --repeat=20 --pallet=pallet_gear --extrinsic=alloc,alloc_in_handle,alloc_per_page,claim_value,create_program,db_read_per_kb,db_write_per_kb,free,gr_block_height,gr_block_timestamp,gr_create_program,gr_create_program_per_kb,gr_create_program_wgas,gr_create_program_wgas_per_kb,gr_debug,gr_debug_per_kb,gr_gas_available,gr_message_id,gr_pay_program_rent,gr_program_id,gr_random,gr_read,gr_read_per_kb,gr_reply_code,gr_reply_deposit,gr_reply_per_kb,gr_reply_push,gr_reply_push_input,gr_reply_push_input_per_kb,gr_reply_push_per_kb,gr_reply_to,gr_reply_wgas_per_kb,gr_reservation_reply_commit_per_kb,gr_reservation_reply_per_kb,gr_reservation_send,gr_reservation_send_commit,gr_reservation_send_per_kb,gr_reserve_gas,gr_send,gr_send_commit,gr_send_commit_wgas,gr_send_init,gr_send_input,gr_send_input_wgas,gr_send_per_kb,gr_send_push,gr_send_push_input,gr_send_push_input_per_kb,gr_send_push_per_kb,gr_send_wgas,gr_send_wgas_per_kb,gr_signal_code,gr_signal_from,gr_size,gr_source,gr_system_reserve_gas,gr_unreserve_gas,gr_value,gr_value_available,gr_wake,initial_allocation,instantiate_module_per_kb,instr_br,instr_br_if,instr_br_table,instr_br_table_per_entry,instr_call,instr_call_const,instr_call_indirect,instr_call_indirect_per_param,instr_call_per_local,instr_global_get,instr_global_set,instr_i32add,instr_i32and,instr_i32clz,instr_i32ctz,instr_i32divs,instr_i32divu,instr_i32eq,instr_i32eqz,instr_i32extend16s,instr_i32extend8s,instr_i32ges,instr_i32geu,instr_i32gts,instr_i32gtu,instr_i32les,instr_i32leu,instr_i32load,instr_i32lts,instr_i32ltu,instr_i32mul,instr_i32ne,instr_i32or,instr_i32popcnt,instr_i32rems,instr_i32remu,instr_i32rotl,instr_i32rotr,instr_i32shl,instr_i32shrs,instr_i32shru,instr_i32store,instr_i32sub,instr_i32wrapi64,instr_i32xor,instr_i64add,instr_i64and,instr_i64clz,instr_i64ctz,instr_i64divs,instr_i64divu,instr_i64eq,instr_i64eqz,instr_i64extend16s,instr_i64extend32s,instr_i64extend8s,instr_i64extendsi32,instr_i64extendui32,instr_i64ges,instr_i64geu,instr_i64gts,instr_i64gtu,instr_i64les,instr_i64leu,instr_i64load,instr_i64lts,instr_i64ltu,instr_i64mul,instr_i64ne,instr_i64or,instr_i64popcnt,instr_i64rems,instr_i64remu,instr_i64rotl,instr_i64rotr,instr_i64shl,instr_i64shrs,instr_i64shru,instr_i64store,instr_i64sub,instr_i64xor,instr_if,instr_local_get,instr_local_set,instr_local_tee,instr_memory_current,instr_select,lazy_pages_host_func_read,lazy_pages_host_func_write,lazy_pages_host_func_write_after_read,lazy_pages_load_page_storage_data,lazy_pages_signal_read,lazy_pages_signal_write,lazy_pages_signal_write_after_read,mem_grow,pay_program_rent,reinstrument_per_kb,resume_session_commit,resume_session_init,resume_session_push,send_message,send_reply,tasks_pause_program,tasks_pause_program_uninited,tasks_remove_from_mailbox,tasks_remove_from_waitlist,tasks_remove_gas_reservation,tasks_remove_resume_session,tasks_send_dispatch,tasks_send_user_message,tasks_send_user_message_to_mailbox,tasks_wake_message,tasks_wake_message_no_wake,upload_code,upload_program,gr_env_vars --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_gear.rs --template=.maintain/frame-weight-template.hbs +// ./target/production/gear benchmark pallet --chain=vara-dev --steps=50 --repeat=20 --pallet=pallet_gear --extrinsic=alloc,alloc_per_page,claim_value,create_program,db_read_per_kb,db_write_per_kb,free,gr_block_height,gr_block_timestamp,gr_create_program,gr_create_program_per_kb,gr_create_program_wgas,gr_create_program_wgas_per_kb,gr_debug,gr_debug_per_kb,gr_gas_available,gr_message_id,gr_pay_program_rent,gr_program_id,gr_random,gr_read,gr_read_per_kb,gr_reply_code,gr_reply_deposit,gr_reply_per_kb,gr_reply_push,gr_reply_push_input,gr_reply_push_input_per_kb,gr_reply_push_per_kb,gr_reply_to,gr_reply_wgas_per_kb,gr_reservation_reply_commit_per_kb,gr_reservation_reply_per_kb,gr_reservation_send,gr_reservation_send_commit,gr_reservation_send_per_kb,gr_reserve_gas,gr_send,gr_send_commit,gr_send_commit_wgas,gr_send_init,gr_send_input,gr_send_input_wgas,gr_send_per_kb,gr_send_push,gr_send_push_input,gr_send_push_input_per_kb,gr_send_push_per_kb,gr_send_wgas,gr_send_wgas_per_kb,gr_signal_code,gr_signal_from,gr_size,gr_source,gr_system_reserve_gas,gr_unreserve_gas,gr_value,gr_value_available,gr_wake,instantiate_module_per_kb,instr_br,instr_br_if,instr_br_table,instr_br_table_per_entry,instr_call,instr_call_const,instr_call_indirect,instr_call_indirect_per_param,instr_call_per_local,instr_global_get,instr_global_set,instr_i32add,instr_i32and,instr_i32clz,instr_i32ctz,instr_i32divs,instr_i32divu,instr_i32eq,instr_i32eqz,instr_i32extend16s,instr_i32extend8s,instr_i32ges,instr_i32geu,instr_i32gts,instr_i32gtu,instr_i32les,instr_i32leu,instr_i32load,instr_i32lts,instr_i32ltu,instr_i32mul,instr_i32ne,instr_i32or,instr_i32popcnt,instr_i32rems,instr_i32remu,instr_i32rotl,instr_i32rotr,instr_i32shl,instr_i32shrs,instr_i32shru,instr_i32store,instr_i32sub,instr_i32wrapi64,instr_i32xor,instr_i64add,instr_i64and,instr_i64clz,instr_i64ctz,instr_i64divs,instr_i64divu,instr_i64eq,instr_i64eqz,instr_i64extend16s,instr_i64extend32s,instr_i64extend8s,instr_i64extendsi32,instr_i64extendui32,instr_i64ges,instr_i64geu,instr_i64gts,instr_i64gtu,instr_i64les,instr_i64leu,instr_i64load,instr_i64lts,instr_i64ltu,instr_i64mul,instr_i64ne,instr_i64or,instr_i64popcnt,instr_i64rems,instr_i64remu,instr_i64rotl,instr_i64rotr,instr_i64shl,instr_i64shrs,instr_i64shru,instr_i64store,instr_i64sub,instr_i64xor,instr_if,instr_local_get,instr_local_set,instr_local_tee,instr_memory_current,instr_select,lazy_pages_host_func_read,lazy_pages_host_func_write,lazy_pages_host_func_write_after_read,lazy_pages_load_page_storage_data,lazy_pages_signal_read,lazy_pages_signal_write,lazy_pages_signal_write_after_read,mem_grow,pay_program_rent,reinstrument_per_kb,resume_session_commit,resume_session_init,resume_session_push,send_message,send_reply,tasks_pause_program,tasks_pause_program_uninited,tasks_remove_from_mailbox,tasks_remove_from_waitlist,tasks_remove_gas_reservation,tasks_remove_resume_session,tasks_send_dispatch,tasks_send_user_message,tasks_send_user_message_to_mailbox,tasks_wake_message,tasks_wake_message_no_wake,upload_code,upload_program,gr_env_vars --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_gear.rs --template=.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,8 +63,6 @@ pub trait WeightInfo { fn upload_program(c: u32, s: u32, ) -> Weight; fn send_message(p: u32, ) -> Weight; fn send_reply(p: u32, ) -> Weight; - fn initial_allocation(q: u32, ) -> Weight; - fn alloc_in_handle(q: u32, ) -> Weight; fn reinstrument_per_kb(c: u32, ) -> Weight; fn alloc(r: u32, ) -> Weight; fn alloc_per_page(p: u32, ) -> Weight; @@ -533,26 +531,6 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } - /// The range of component `q` is `[1, 512]`. - fn initial_allocation(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 375_457_000 picoseconds. - Weight::from_parts(393_536_920, 121468) - .saturating_add(T::DbWeight::get().reads(35_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } - /// The range of component `q` is `[0, 512]`. - fn alloc_in_handle(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 390_030_000 picoseconds. - Weight::from_parts(411_717_925, 121468) - .saturating_add(T::DbWeight::get().reads(35_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } /// The range of component `c` is `[0, 512]`. fn reinstrument_per_kb(c: u32, ) -> Weight { // Proof Size summary in bytes: @@ -2524,26 +2502,6 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } - /// The range of component `q` is `[1, 512]`. - fn initial_allocation(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 375_457_000 picoseconds. - Weight::from_parts(393_536_920, 121468) - .saturating_add(RocksDbWeight::get().reads(35_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) - } - /// The range of component `q` is `[0, 512]`. - fn alloc_in_handle(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 390_030_000 picoseconds. - Weight::from_parts(411_717_925, 121468) - .saturating_add(RocksDbWeight::get().reads(35_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) - } /// The range of component `c` is `[0, 512]`. fn reinstrument_per_kb(c: u32, ) -> Weight { // Proof Size summary in bytes: diff --git a/runtime/vara/src/weights/pallet_gear.rs b/runtime/vara/src/weights/pallet_gear.rs index 76d4cbfb0af..2d5585324cf 100644 --- a/runtime/vara/src/weights/pallet_gear.rs +++ b/runtime/vara/src/weights/pallet_gear.rs @@ -25,7 +25,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("vara-dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/gear benchmark pallet --chain=vara-dev --steps=50 --repeat=20 --pallet=pallet_gear --extrinsic=alloc,alloc_in_handle,alloc_per_page,claim_value,create_program,db_read_per_kb,db_write_per_kb,free,free_range,free_range_per_page,gr_block_height,gr_block_timestamp,gr_create_program,gr_create_program_per_kb,gr_create_program_wgas,gr_create_program_wgas_per_kb,gr_debug,gr_debug_per_kb,gr_env_vars,gr_gas_available,gr_message_id,gr_pay_program_rent,gr_program_id,gr_random,gr_read,gr_read_per_kb,gr_reply_code,gr_reply_deposit,gr_reply_per_kb,gr_reply_push,gr_reply_push_input,gr_reply_push_input_per_kb,gr_reply_push_per_kb,gr_reply_to,gr_reply_wgas_per_kb,gr_reservation_reply_commit_per_kb,gr_reservation_reply_per_kb,gr_reservation_send,gr_reservation_send_commit,gr_reservation_send_per_kb,gr_reserve_gas,gr_send,gr_send_commit,gr_send_commit_wgas,gr_send_init,gr_send_input,gr_send_input_wgas,gr_send_per_kb,gr_send_push,gr_send_push_input,gr_send_push_input_per_kb,gr_send_push_per_kb,gr_send_wgas,gr_send_wgas_per_kb,gr_signal_code,gr_signal_from,gr_size,gr_source,gr_system_reserve_gas,gr_unreserve_gas,gr_value,gr_value_available,gr_wake,initial_allocation,instantiate_module_per_kb,instr_br,instr_br_if,instr_br_table,instr_br_table_per_entry,instr_call,instr_call_const,instr_call_indirect,instr_call_indirect_per_param,instr_call_per_local,instr_global_get,instr_global_set,instr_i32add,instr_i32and,instr_i32clz,instr_i32ctz,instr_i32divs,instr_i32divu,instr_i32eq,instr_i32eqz,instr_i32extend16s,instr_i32extend8s,instr_i32ges,instr_i32geu,instr_i32gts,instr_i32gtu,instr_i32les,instr_i32leu,instr_i32load,instr_i32lts,instr_i32ltu,instr_i32mul,instr_i32ne,instr_i32or,instr_i32popcnt,instr_i32rems,instr_i32remu,instr_i32rotl,instr_i32rotr,instr_i32shl,instr_i32shrs,instr_i32shru,instr_i32store,instr_i32sub,instr_i32wrapi64,instr_i32xor,instr_i64add,instr_i64and,instr_i64clz,instr_i64ctz,instr_i64divs,instr_i64divu,instr_i64eq,instr_i64eqz,instr_i64extend16s,instr_i64extend32s,instr_i64extend8s,instr_i64extendsi32,instr_i64extendui32,instr_i64ges,instr_i64geu,instr_i64gts,instr_i64gtu,instr_i64les,instr_i64leu,instr_i64load,instr_i64lts,instr_i64ltu,instr_i64mul,instr_i64ne,instr_i64or,instr_i64popcnt,instr_i64rems,instr_i64remu,instr_i64rotl,instr_i64rotr,instr_i64shl,instr_i64shrs,instr_i64shru,instr_i64store,instr_i64sub,instr_i64xor,instr_if,instr_local_get,instr_local_set,instr_local_tee,instr_memory_current,instr_select,lazy_pages_host_func_read,lazy_pages_host_func_write,lazy_pages_host_func_write_after_read,lazy_pages_load_page_storage_data,lazy_pages_signal_read,lazy_pages_signal_write,lazy_pages_signal_write_after_read,mem_grow,pay_program_rent,reinstrument_per_kb,resume_session_commit,resume_session_init,resume_session_push,send_message,send_reply,tasks_pause_program,tasks_pause_program_uninited,tasks_remove_from_mailbox,tasks_remove_from_waitlist,tasks_remove_gas_reservation,tasks_remove_resume_session,tasks_send_dispatch,tasks_send_user_message,tasks_send_user_message_to_mailbox,tasks_wake_message,tasks_wake_message_no_wake,upload_code,upload_program --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_gear.rs --template=.maintain/frame-weight-template.hbs +// ./target/production/gear benchmark pallet --chain=vara-dev --steps=50 --repeat=20 --pallet=pallet_gear --extrinsic=alloc,alloc_per_page,claim_value,create_program,db_read_per_kb,db_write_per_kb,free,free_range,free_range_per_page,gr_block_height,gr_block_timestamp,gr_create_program,gr_create_program_per_kb,gr_create_program_wgas,gr_create_program_wgas_per_kb,gr_debug,gr_debug_per_kb,gr_env_vars,gr_gas_available,gr_message_id,gr_pay_program_rent,gr_program_id,gr_random,gr_read,gr_read_per_kb,gr_reply_code,gr_reply_deposit,gr_reply_per_kb,gr_reply_push,gr_reply_push_input,gr_reply_push_input_per_kb,gr_reply_push_per_kb,gr_reply_to,gr_reply_wgas_per_kb,gr_reservation_reply_commit_per_kb,gr_reservation_reply_per_kb,gr_reservation_send,gr_reservation_send_commit,gr_reservation_send_per_kb,gr_reserve_gas,gr_send,gr_send_commit,gr_send_commit_wgas,gr_send_init,gr_send_input,gr_send_input_wgas,gr_send_per_kb,gr_send_push,gr_send_push_input,gr_send_push_input_per_kb,gr_send_push_per_kb,gr_send_wgas,gr_send_wgas_per_kb,gr_signal_code,gr_signal_from,gr_size,gr_source,gr_system_reserve_gas,gr_unreserve_gas,gr_value,gr_value_available,gr_wake,instantiate_module_per_kb,instr_br,instr_br_if,instr_br_table,instr_br_table_per_entry,instr_call,instr_call_const,instr_call_indirect,instr_call_indirect_per_param,instr_call_per_local,instr_global_get,instr_global_set,instr_i32add,instr_i32and,instr_i32clz,instr_i32ctz,instr_i32divs,instr_i32divu,instr_i32eq,instr_i32eqz,instr_i32extend16s,instr_i32extend8s,instr_i32ges,instr_i32geu,instr_i32gts,instr_i32gtu,instr_i32les,instr_i32leu,instr_i32load,instr_i32lts,instr_i32ltu,instr_i32mul,instr_i32ne,instr_i32or,instr_i32popcnt,instr_i32rems,instr_i32remu,instr_i32rotl,instr_i32rotr,instr_i32shl,instr_i32shrs,instr_i32shru,instr_i32store,instr_i32sub,instr_i32wrapi64,instr_i32xor,instr_i64add,instr_i64and,instr_i64clz,instr_i64ctz,instr_i64divs,instr_i64divu,instr_i64eq,instr_i64eqz,instr_i64extend16s,instr_i64extend32s,instr_i64extend8s,instr_i64extendsi32,instr_i64extendui32,instr_i64ges,instr_i64geu,instr_i64gts,instr_i64gtu,instr_i64les,instr_i64leu,instr_i64load,instr_i64lts,instr_i64ltu,instr_i64mul,instr_i64ne,instr_i64or,instr_i64popcnt,instr_i64rems,instr_i64remu,instr_i64rotl,instr_i64rotr,instr_i64shl,instr_i64shrs,instr_i64shru,instr_i64store,instr_i64sub,instr_i64xor,instr_if,instr_local_get,instr_local_set,instr_local_tee,instr_memory_current,instr_select,lazy_pages_host_func_read,lazy_pages_host_func_write,lazy_pages_host_func_write_after_read,lazy_pages_load_page_storage_data,lazy_pages_signal_read,lazy_pages_signal_write,lazy_pages_signal_write_after_read,mem_grow,pay_program_rent,reinstrument_per_kb,resume_session_commit,resume_session_init,resume_session_push,send_message,send_reply,tasks_pause_program,tasks_pause_program_uninited,tasks_remove_from_mailbox,tasks_remove_from_waitlist,tasks_remove_gas_reservation,tasks_remove_resume_session,tasks_send_dispatch,tasks_send_user_message,tasks_send_user_message_to_mailbox,tasks_wake_message,tasks_wake_message_no_wake,upload_code,upload_program --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./scripts/benchmarking/weights-output/pallet_gear.rs --template=.maintain/frame-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -63,8 +63,6 @@ pub trait WeightInfo { fn upload_program(c: u32, s: u32, ) -> Weight; fn send_message(p: u32, ) -> Weight; fn send_reply(p: u32, ) -> Weight; - fn initial_allocation(q: u32, ) -> Weight; - fn alloc_in_handle(q: u32, ) -> Weight; fn reinstrument_per_kb(c: u32, ) -> Weight; fn alloc(r: u32, ) -> Weight; fn alloc_per_page(p: u32, ) -> Weight; @@ -533,26 +531,6 @@ impl pallet_gear::WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(13_u64)) } - /// The range of component `q` is `[1, 512]`. - fn initial_allocation(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 375_457_000 picoseconds. - Weight::from_parts(393_536_920, 121468) - .saturating_add(T::DbWeight::get().reads(35_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } - /// The range of component `q` is `[0, 512]`. - fn alloc_in_handle(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 390_030_000 picoseconds. - Weight::from_parts(411_717_925, 121468) - .saturating_add(T::DbWeight::get().reads(35_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } /// The range of component `c` is `[0, 512]`. fn reinstrument_per_kb(c: u32, ) -> Weight { // Proof Size summary in bytes: @@ -2524,26 +2502,6 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(13_u64)) } - /// The range of component `q` is `[1, 512]`. - fn initial_allocation(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 375_457_000 picoseconds. - Weight::from_parts(393_536_920, 121468) - .saturating_add(RocksDbWeight::get().reads(35_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) - } - /// The range of component `q` is `[0, 512]`. - fn alloc_in_handle(_q: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1897` - // Estimated: `121468` - // Minimum execution time: 390_030_000 picoseconds. - Weight::from_parts(411_717_925, 121468) - .saturating_add(RocksDbWeight::get().reads(35_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) - } /// The range of component `c` is `[0, 512]`. fn reinstrument_per_kb(c: u32, ) -> Weight { // Proof Size summary in bytes: