-
Notifications
You must be signed in to change notification settings - Fork 9
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
perf: reduce Result checks in Gasometer #11
Conversation
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.
LGTM.
@joshuajbouw what are the possibilities of adding this generic changes upstream?
The NEAR gas reduction numbers have been missing - posting them here:
|
Merged in 148c6f9 (did not go into master since we have a hard time getting our changes into upstream; but it is included in our internal release https://github.com/aurora-is-near/sputnikvm/releases/tag/v0.37.2-aurora ) |
Gasometer
has a fieldinner: Result<Inner<'config>, ExitError>
. Thatfield is often accessed in
Gasometer
's methodrecord_dynamic_cost
, whichinvolves a lot of
?
operators. This was identified as inefficiency in #448 (2nd item).To improve performance, a mutable reference to
Inner
is stored in a variableand used througout
record_dynamic_cost
, which allows to remove most?
inthat method.
Snapshot::new()
is added to avoid ownership issues when compiling with--features tracing
.Gasometer::snapshot()
borrowsself
, which can beavoided by using
Snapshot::new
instead.NEAR gas reductions
Including this in
aurora-engine
makes the following tests fail due to NEAR gasusage which is lower than the expected numbers:
Reproduction
Patch
aurora-engine
to include the locally modifiedsputnikvm
:Run tests with: