Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Implement bitmask for SecondaryMap serialization #1158

Closed
wants to merge 1 commit into from

Conversation

mrowqa
Copy link
Contributor

@mrowqa mrowqa commented Oct 18, 2019

Small improvement I was supposed to implement earlier. Might help dtolnay/watt#2.

r? @sunfishcode

@bnjbvr
Copy link
Member

bnjbvr commented Jan 22, 2020

Hey @mrowqa, can you give some context around this change: why is it useful, what does it change? (if it becomes lengthy, please open an issue!)

Is this covered by tests, and if not can you add some, please? Thanks!

@mrowqa
Copy link
Contributor Author

mrowqa commented Jan 22, 2020

The original reason was cache system in Wasmtime. It uses serde for serialization of compilation cache which consists of SecondaryMaps (among others). At the time of implementing the cache system, I had implemented simpler SecondaryMap serializer (current code) that uses whole byte for a bit flag (presence of an object at a given index) and this PR changes the serializer to pack these bit flags compactly. After implementing the simpler serialization, I had added compression to the cache system, so using whole bytes for single bit information shouldn't affect too much the size of the final cache that lands on user disk. I haven't measured the difference in performance and peak memory usage (intermediate step - after decompression, before deserialization) that this PR introduces.

The change is tested by Wasmtime cache system tests.

CC @sunfishcode

@alexcrichton
Copy link
Member

Thanks for the PR again, and as a procedural note the Cranelift repository has now merged into the wasmtime repository.

PRs are no longer landing in this repository, and unfortunately there's no "one button" solution to move a PR to the wasmtime repository. A script has been prepared, however, to assist you in transferring this PR to the wasmtime repo. Feel free to reach out on Zulip with any questions!

@tschneidereit
Copy link
Member

We'll archive this repository in favor of the Wasmtime repository — see Alex's comment about the merge above. I'm closing this PR now in order to have an explanation in a comment before archiving the repo auto-closes all PRs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants