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
Add new gas metering method: mutable global + local gas
function
#34
Conversation
… the gas_left global to its value at their very start
08fd288
to
4389779
Compare
new benches is WIP (coming soon) |
gas
functiongas
function
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.
Let's do not perform more work in the gas function as necessary.
e7b35c0
to
1290935
Compare
With new This problem:
will be addressed in a follow-up PR. |
gas
functiongas
function
Benchesversion tested: 6f43fbc with
|
fixture | host func | mut global | perf |
---|---|---|---|
coremark | 20.81 s | 20.20 s | +3% |
recursive_ok | 367 µs | 585 µs | -37% |
fibonacci_recursive | 9.15 µs | 13.56 µs | -33% |
factorial_recursive | 1.50 µs | 1.98 µs | -24% |
count_until | 5.03 ms | 8.13 ms | -38% |
memory_vec_add | 6.21 ms | 8.45 ms | -27% |
tiny_keccak | 925 µs | 1080 µs | -14% |
global_bump | 3.79 ms | 7.03 ms | -46% |
db2d4e5
to
5084aa4
Compare
5084aa4
to
66e8833
Compare
Solves #11
In addition to method used beforehand (i.e. injection of calls to an imported
gas
function into metering blocks), this new method now available too, which:gas
function which subtracts the gas spent from the global, and dropsunreachable
if out of gas.This new method should make the resulting module more efficient in terms of execution time, as invoking an imported
gas
host function every metering block adds an overhead. Synchronization between the global and the runtime should be implemented on the execution engine side.