Inline function execution with bytecode evaluation #784
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
Updates
run_bytecode
in javy-core to take an optional function name to execute and execute it if it's provided.Why am I making this change?
This substantially reduces the amount of fuel to call an exported function with dynamically linked modules. This also allows re-using a runtime after using it when calling
compile_src
(see #781).In terms of performance numbers, given a function that looks like:
Fuel usage will increase from 36,929 to 36,983 (54 instructions).
Given a function that looks like:
Fuel usage will decrease from 92,080 to 40,283 (51,797 instructions).
I'm opting to not to update the
main.rs
file for the time being because I'm planning to have it deleted soon.Checklist
javy-cli
andjavy-core
do not require updating CHANGELOG files.