[perf] Runtime: Optimize gas counter by splitting burn_gas
and used_gas
#3071
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
Milestone
I’m thinking we should refactor
GasCounter
to splitburn_gas
andused_gas
. Right nowused_gas
includesburn_gas
which makes logic more complicated when we need to increment onlyburn_gas
This might save us 2X in the critical path, since
used_gas
increases are more rare thanburn_gas
.The critical path in
near-vm-logic
is the call to host functiongas(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.The text was updated successfully, but these errors were encountered: