Stream: git-wasmtime

Topic: wasmtime / PR #6971 Optimize `list<u8>` lifting and lowering


view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 18:55):

alexcrichton opened PR #6971 from alexcrichton:opt-lift-lower-for-primitives to bytecodealliance:main:

This commit optimizes the lifting and lowering routines for list<u8> and other similar primitive integer types. The current lifting/lowering is intended to be general-purpose and correct but doesn't optimize well with LLVM for a number of reasons. I first attempted to reshape the general-purpose code to be easier for LLVM to optimize but in the end was unable to convince LLVM that various pointers here don't alias which meant that the general-purpose lowering/lifting never optimized well.

Instead, however, I've added new trait methods which are implemented the same way as the general purpose methods beforehand. The integer/primitive implementations overwrite these implementations with more specialized versions given knowledge of primitives.

On a local benchmark this makes lifting/lowering disappear from a profile since memcpy is generally much faster than per-item processing.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 18:55):

alexcrichton requested pchickey for a review on PR #6971.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 18:55):

alexcrichton requested wasmtime-core-reviewers for a review on PR #6971.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 20:55):

pchickey submitted PR review:

Awesome!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2023 at 22:02):

alexcrichton merged PR #6971.


Last updated: Dec 23 2024 at 12:05 UTC