Further compress the in-memory representation of address maps - #2324
Merged
Conversation
Subscribe to Label Actioncc @peterhuene DetailsThis issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
alexcrichton
force-pushed
the
compress-again
branch
from
October 27, 2020 00:14
06ff852 to
3b74553
Compare
Member
Author
|
@peterhuene would you be able to take a look at this? |
peterhuene
self-requested a review
November 2, 2020 23:56
peterhuene
reviewed
Nov 3, 2020
peterhuene
approved these changes
Nov 3, 2020
peterhuene
left a comment
Member
There was a problem hiding this comment.
Looks great 👍. I Just that one question related to a test as to not change the assert; not a blocker in any sense.
This commit reduces the size of `InstructionAddressMap` from 24 bytes to 8 bytes by dropping the `code_len` field and reducing `code_offset` to `u32` instead of `usize`. The intention is to primarily make the in-memory version take up less space, and the hunch is that the `code_len` is largely not necessary since most entries in this map are always adjacent to one another. The `code_len` field is now implied by the `code_offset` field of the next entry in the map. This isn't as big of an improvement to serialized module size as bytecodealliance#2321 or bytecodealliance#2322, primarily because of the switch to variable-length encoding. Despite this though it shaves about 10MB off the encoded size of the module from bytecodealliance#2318
alexcrichton
force-pushed
the
compress-again
branch
from
November 3, 2020 02:05
3b74553 to
b4d1037
Compare
cfallin
pushed a commit
that referenced
this pull request
Nov 30, 2020
This commit reduces the size of `InstructionAddressMap` from 24 bytes to 8 bytes by dropping the `code_len` field and reducing `code_offset` to `u32` instead of `usize`. The intention is to primarily make the in-memory version take up less space, and the hunch is that the `code_len` is largely not necessary since most entries in this map are always adjacent to one another. The `code_len` field is now implied by the `code_offset` field of the next entry in the map. This isn't as big of an improvement to serialized module size as #2321 or #2322, primarily because of the switch to variable-length encoding. Despite this though it shaves about 10MB off the encoded size of the module from #2318
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit reduces the size of
InstructionAddressMapfrom 24 bytes to8 bytes by dropping the
code_lenfield and reducingcode_offsettou32instead ofusize. The intention is to primarily make thein-memory version take up less space, and the hunch is that the
code_lenis largely not necessary since most entries in this map arealways adjacent to one another. The
code_lenfield is now implied bythe
code_offsetfield of the next entry in the map.This isn't as big of an improvement to serialized module size as #2321
or #2322, primarily because of the switch to variable-length encoding.
Despite this though it shaves about 10MB off the encoded size of the
module from #2318