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

Refine read leb in wasm loader of fast interpreter #4017

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

wenyongh
Copy link
Contributor

@wenyongh wenyongh commented Jan 10, 2025

For the wasm loader of fast interpreter, since the leb format has been checked
in the first time traversing, we can skip the check in the second time traversing.
This PR calls read_leb_quick instead of read_leb_xxx in the second time scan to
improve the loader's performance.

@wenyongh wenyongh changed the title [test] Refine read leb int wasm loader of fast interpreter Refine read leb int wasm loader of fast interpreter Jan 11, 2025
@wenyongh wenyongh changed the title Refine read leb int wasm loader of fast interpreter Refine read leb in wasm loader of fast interpreter Jan 11, 2025
Copy link
Collaborator

@lum1n0us lum1n0us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Just a thought – perhaps a leb-cache (mapping from leb values to constant values) would be more effective. It could be shared across different running modes.

Copy link
Collaborator

@TianlongLiang TianlongLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh
Copy link
Contributor Author

LGTM.

Just a thought – perhaps a leb-cache (mapping from leb values to constant values) would be more effective. It could be shared across different running modes.

leb128 is encoded with variant length, the length of bytes can not be pre-known, and the so-called value may have more than 4 bytes for uint32/int32 and more than 8 bytes for int64, I just have no good idea to create the map.

@lum1n0us lum1n0us merged commit 9c3807e into bytecodealliance:main Jan 14, 2025
383 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants