Stream: git-wasmtime

Topic: wasmtime / PR #12490 perf(wasi-nn): avoid extra allocatio...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2026 at 16:51):

ANtutov requested wasmtime-wasi-reviewers for a review on PR #12490.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2026 at 16:51):

ANtutov opened PR #12490 from ANtutov:perf/wasi-nn-tensor-bytes to bytecodealliance:main:

<!-- Why these changes? -->
Previously the helper functions converting between Vec<f32> and Vec<u8> allocated intermediate vectors and iterated over the data twice, adding unnecessary overhead for large tensors and example code.

<!-- What is changed? -->
Reimplemented f32_vec_to_bytes and bytes_to_f32_vec (and their copies in the ONNX and WinML examples) to build the output vectors in a single pass without temporary collections, while preserving little-endian encoding and the existing panic behavior on invalid input lengths.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2026 at 18:41):

alexcrichton commented on PR #12490:

cc @rahulchaphalkar @jlb6740


Last updated: Feb 24 2026 at 04:36 UTC