Skip to content
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] Runtime: Optimize gas counter by splitting burn_gas and used_gas #3071

Closed
evgenykuzyakov opened this issue Aug 3, 2020 · 1 comment
Assignees
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-enhancement Category: An issue proposing an enhancement or a PR with one. C-housekeeping Category: Refactoring, cleanups, code quality

Comments

@evgenykuzyakov
Copy link
Collaborator

I’m thinking we should refactor GasCounter to split burn_gas and used_gas . Right now used_gas includes burn_gas which makes logic more complicated when we need to increment only burn_gas

This might save us 2X in the critical path, since used_gas increases are more rare than burn_gas.

The critical path in near-vm-logic is the call to host function gas(amount) from the VM as part of gas metering.

This change will require to touch most of the vm-logic host functions but will simplify the code.

@evgenykuzyakov evgenykuzyakov added C-enhancement Category: An issue proposing an enhancement or a PR with one. C-housekeeping Category: Refactoring, cleanups, code quality A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) labels Aug 3, 2020
@olonho
Copy link
Contributor

olonho commented Aug 18, 2020

Think it is to be done after #3038 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-enhancement Category: An issue proposing an enhancement or a PR with one. C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants