wasmi-labs/wasmi

Reconsider proper fuel charging for lazily compiled functions

Robbepop opened this issue · 0 comments

Currently when compiling a function lazily while fuel metering is enabled fuel is charged equal to the number of bytes that make up the lazily compiled function body. This means that the current fuel model treats function compilation as if it was as slow or fast as call to memset with the same number of bytes. This is totally not realistic and we should choose a proper number.

Accordings to some research and tests conducted so far it seems likely that Wasmi function compilation takes between 20-30 times longer, thus we should likely multiple the current number with such a number.

Alternatively we could provide Wasmi users with means to customize fuel charging on their own via the wasmi::Config type.