-
Notifications
You must be signed in to change notification settings - Fork 83
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
Gas used and execution time measurement for the Move function #2031
base: main
Are you sure you want to change the base?
Gas used and execution time measurement for the Move function #2031
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
fn inject_parameter( | ||
_gas_params: &MeasurementGas, | ||
context: &mut NativeContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NativeContext is initialized each time a native function is called, a mechanism is needed to maintain gas statistics throughout the entire transaction execution process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom a Native context like NativeEventContext
or ObjectRuntimeContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom a Native context like
NativeEventContext
orObjectRuntimeContext
OK, got it.
看上去,除了transfer gas 非常高外,以下几个方法的 gas 也有些高的不合理
|
这个也挺高 gas_used: 4488935, time_used 2 -> "rooch_framework::account_coin_store::deposit_internal" |
|
感觉这个方法的代码侵入性有点强,感觉可以通过 rust 的 feature 来控制,可以参照:
然后 |
好,我修改一下。 |
The current gas statistics for running the transfer command are as follows:
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.