Stream: git-wasmtime

Topic: wasmtime / issue #5050 Host component import function par...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 12 2022 at 17:58):

pchickey opened issue #5050:

Feature

Host component import function parameters should take borrowed values.

Presently, the arguments to a host component import function (as provided to wasmtime::component::LinkerInstance::func_wrap) have to implement IntoComponentFunc, whose argument list is required to impl Lift. Lift does not allow borrowed values. So, these import functions are passed String when it would be better for them to accept &str.

Benefit

Passing in a borrowed value will reduce the number of copies required to output lists. The implementation of a synchronous fd_write would benefit from this optimization.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 12 2022 at 17:58):

pchickey labeled issue #5050:

Feature

Host component import function parameters should take borrowed values.

Presently, the arguments to a host component import function (as provided to wasmtime::component::LinkerInstance::func_wrap) have to implement IntoComponentFunc, whose argument list is required to impl Lift. Lift does not allow borrowed values. So, these import functions are passed String when it would be better for them to accept &str.

Benefit

Passing in a borrowed value will reduce the number of copies required to output lists. The implementation of a synchronous fd_write would benefit from this optimization.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 12 2022 at 18:59):

pchickey edited issue #5050:

Feature

Host component import function parameters should take borrowed values.

Presently, the arguments to a host component import function (as provided to wasmtime::component::LinkerInstance::func_wrap) have to implement IntoComponentFunc, whose argument list is required to impl Lift. Lift does not allow borrowed values. So, these import functions are passed String or Vec<u8> when it would be better for them to accept &str or &[u8]. A borrowed value would be able to point to memory in a guest linear memory, whereas an owned value requires a copy out of linear memory.

Benefit

Passing in a borrowed value will reduce the number of copies required to output lists. The implementation of a synchronous fd_write would benefit from this optimization.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 12 2022 at 19:00):

pchickey edited issue #5050:

Feature

Host component import function parameters should take borrowed values.

Presently, the arguments to a host component import function (as provided to wasmtime::component::LinkerInstance::func_wrap) have to implement IntoComponentFunc, whose argument list is required to impl Lift. Lift does not allow borrowed values. So, these import functions are passed String or Vec<u8> when it would be better for them to accept &str or &[u8].

Benefit

Passing in a borrowed value will reduce the number of copies required to output lists. A borrowed value would be able to point to memory in a guest linear memory, whereas an owned value requires a copy out of linear memory.

The implementation of a synchronous fd_write would benefit from this optimization.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2022 at 21:30):

pchickey commented on issue #5050:

I got this wrong. Borrowed values are available in parameters to import funcs via WasmStr and WasmList. Wasmtime has what we need, so I'll file an issue on wit-bindgen to use them.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2022 at 21:30):

pchickey closed issue #5050:

Feature

Host component import function parameters should take borrowed values.

Presently, the arguments to a host component import function (as provided to wasmtime::component::LinkerInstance::func_wrap) have to implement IntoComponentFunc, whose argument list is required to impl Lift. Lift does not allow borrowed values. So, these import functions are passed String or Vec<u8> when it would be better for them to accept &str or &[u8].

Benefit

Passing in a borrowed value will reduce the number of copies required to output lists. A borrowed value would be able to point to memory in a guest linear memory, whereas an owned value requires a copy out of linear memory.

The implementation of a synchronous fd_write would benefit from this optimization.


Last updated: Nov 22 2024 at 17:03 UTC