rooch icon indicating copy to clipboard operation
rooch copied to clipboard

Gas used and execution time measurement for the Move function

Open steelgeek091 opened this issue 7 months ago • 6 comments

The current gas statistics for running the transfer command are as follows:

gas_used: 910165, time_used 1 -> "rooch_framework::account_coin_store::can_auto_accept_coin"    
gas_used: 950158, time_used 1 -> "rooch_framework::account_coin_store::is_accept_coin"    
gas_used: 8754, time_used 0 -> "moveos_std::bcs::to_bytes"    
gas_used: 30871, time_used 0 -> "moveos_std::type_info::type_name"    
gas_used: 48950, time_used 0 -> "moveos_std::bcs::from_bytes"    
gas_used: 81248, time_used 0 -> "moveos_std::address::from_bytes"    
gas_used: 11903, time_used 0 -> "moveos_std::object::address_to_object_id"    
gas_used: 2635151, time_used 1 -> "moveos_std::object::account_named_object_id"    
gas_used: 2673687, time_used 1 -> "rooch_framework::account_coin_store::account_coin_store_id"    
gas_used: 14165, time_used 0 -> "moveos_std::object::parent_id"    
gas_used: 13403, time_used 0 -> "moveos_std::object::is_parent"    
gas_used: 60329, time_used 0 -> "moveos_std::object::contains_object_field_internal"    
gas_used: 145125, time_used 0 -> "moveos_std::object::exists_object_with_type"    
gas_used: 14165, time_used 0 -> "moveos_std::object::parent_id"    
gas_used: 13403, time_used 0 -> "moveos_std::object::is_parent"    
gas_used: 60329, time_used 0 -> "moveos_std::object::contains_object_field_internal"    
gas_used: 145125, time_used 0 -> "moveos_std::object::exists_object_with_type"    
gas_used: 14165, time_used 0 -> "moveos_std::object::parent_id"    
gas_used: 13403, time_used 0 -> "moveos_std::object::is_parent"    
gas_used: 9323, time_used 0 -> "moveos_std::object::is_frozen_internal"    
gas_used: 106172, time_used 0 -> "moveos_std::object::borrow_mut_object_field_internal"    
gas_used: 191096, time_used 0 -> "moveos_std::object::borrow_mut_from_global"    
gas_used: 7608, time_used 0 -> "moveos_std::object::as_mut_ref"    
gas_used: 267502, time_used 0 -> "moveos_std::object::borrow_mut_object_internal"    
gas_used: 303529, time_used 0 -> "moveos_std::object::borrow_mut_object_extend"    
gas_used: 523633, time_used 0 -> "rooch_framework::coin_store::borrow_mut_coin_store_internal"    
gas_used: 3459720, time_used 1 -> "rooch_framework::account_coin_store::create_or_borrow_mut_account_coin_store"    
gas_used: 4488935, time_used 2 -> "rooch_framework::account_coin_store::deposit_internal"    
gas_used: 1174, time_used 0 -> "moveos_std::object::id"    
gas_used: 14165, time_used 1 -> "moveos_std::object::parent_id"    
gas_used: 13403, time_used 0 -> "moveos_std::object::is_parent"    
gas_used: 9323, time_used 0 -> "moveos_std::object::is_frozen_internal"    
gas_used: 106172, time_used 0 -> "moveos_std::object::borrow_mut_object_field_internal"    
gas_used: 191096, time_used 1 -> "moveos_std::object::borrow_mut_from_global"    
gas_used: 228592, time_used 1 -> "moveos_std::object::borrow_mut"    
gas_used: 5400, time_used 0 -> "rooch_framework::coin_store::check_coin_store_not_frozen"    
gas_used: 934, time_used 0 -> "rooch_framework::coin::value"    
gas_used: 41260, time_used 0 -> "rooch_framework::coin_store::merge_to_balance"    
gas_used: 29180, time_used 0 -> "moveos_std::type_info::type_name"    
gas_used: 3210, time_used 0 -> "moveos_std::event::emit"    
gas_used: 550067, time_used 1 -> "rooch_framework::coin_store::deposit_internal"    
gas_used: 9031177, time_used 5 -> "rooch_framework::account_coin_store::transfer_internal"    
gas_used: 9112407, time_used 5 -> "rooch_framework::account_coin_store::transfer"    

Additionally, since NativeContext is initialized each time a native function is called, a mechanism is needed to maintain gas statistics throughout the entire transaction execution process.

steelgeek091 avatar Jun 29 '24 09:06 steelgeek091