Stream: git-wasmtime

Topic: wasmtime / PR #3253 Remove some allocations in `CodeMemory`


view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2021 at 21:50):

alexcrichton opened PR #3253 from less-alloc-in-code-memory to main:

This commit removes the FinishedFunctions type as well as allocations
associated with trampolines when allocating inside of a CodeMemory.
The main goal of this commit is to improve the time spent in
CodeMemory where currently today a good portion of time is spent
simply parsing symbol names and trying to extract function indices from
them. Instead this commit implements a new strategy (different from #3236)
where compilation records offset/length information for all
functions/trampolines so this doesn't need to be re-learned from the
object file later.

A consequence of this commit is that this offset information will be
decoded/encoded through bincode unconditionally, but we can also
optimize that later if necessary as well.

Internally this involved quite a bit of refactoring since the previous
map for FinishedFunctions was relatively heavily relied upon.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2021 at 21:50):

alexcrichton requested cfallin for a review on PR #3253.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2021 at 22:16):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2021 at 23:28):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2021 at 02:23):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2021 at 05:53):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2021 at 05:55):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 27 2021 at 06:11):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 02:21):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 02:21):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 02:21):

cfallin created PR review comment:

Doc comment on this function indicating what the return-tuple is? I have to look at the body right now to see -- something like "Returns the trampoline in each direction: (host_to_wasm, wasm_to_host)" would help a lot.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 14:25):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 14:26):

alexcrichton updated PR #3253 from less-alloc-in-code-memory to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 14:26):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 14:26):

alexcrichton created PR review comment:

:+1: I added this to the trait documentation in wasmtime-environ

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 15:22):

alexcrichton edited PR #3253 from less-alloc-in-code-memory to main:

This commit removes the FinishedFunctions type as well as allocations
associated with trampolines when allocating inside of a CodeMemory.
The main goal of this commit is to improve the time spent in
CodeMemory where currently today a good portion of time is spent
simply parsing symbol names and trying to extract function indices from
them. Instead this commit implements a new strategy (different from #3236)
where compilation records offset/length information for all
functions/trampolines so this doesn't need to be re-learned from the
object file later.

A consequence of this commit is that this offset information will be
decoded/encoded through bincode unconditionally, but we can also
optimize that later if necessary as well.

Internally this involved quite a bit of refactoring since the previous
map for FinishedFunctions was relatively heavily relied upon.

cc #3230

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2021 at 15:35):

alexcrichton merged PR #3253.


Last updated: Dec 23 2024 at 13:07 UTC