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 aCodeMemory
.
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 throughbincode
unconditionally, but we can also
optimize that later if necessary as well.Internally this involved quite a bit of refactoring since the previous
map forFinishedFunctions
was relatively heavily relied upon.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton requested cfallin for a review on PR #3253.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
cfallin submitted PR review.
cfallin submitted PR review.
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.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton updated PR #3253 from less-alloc-in-code-memory
to main
.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
:+1: I added this to the trait documentation in
wasmtime-environ
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 aCodeMemory
.
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 throughbincode
unconditionally, but we can also
optimize that later if necessary as well.Internally this involved quite a bit of refactoring since the previous
map forFinishedFunctions
was relatively heavily relied upon.cc #3230
alexcrichton merged PR #3253.
Last updated: Nov 22 2024 at 16:03 UTC