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 implementIntoComponentFunc
, whose argument list is required to implLift
.Lift
does not allow borrowed values. So, these import functions are passedString
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.
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 implementIntoComponentFunc
, whose argument list is required to implLift
.Lift
does not allow borrowed values. So, these import functions are passedString
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.
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 implementIntoComponentFunc
, whose argument list is required to implLift
.Lift
does not allow borrowed values. So, these import functions are passedString
orVec<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.
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 implementIntoComponentFunc
, whose argument list is required to implLift
.Lift
does not allow borrowed values. So, these import functions are passedString
orVec<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.
pchickey commented on issue #5050:
I got this wrong. Borrowed values are available in parameters to import funcs via
WasmStr
andWasmList
. Wasmtime has what we need, so I'll file an issue on wit-bindgen to use them.
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 implementIntoComponentFunc
, whose argument list is required to implLift
.Lift
does not allow borrowed values. So, these import functions are passedString
orVec<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: Dec 23 2024 at 13:07 UTC