Stream: git-wasmtime

Topic: wasmtime / issue #9686 How to speed-up calls into rust


view this post on Zulip Wasmtime GitHub notifications bot (Nov 26 2024 at 12:58):

fabianmurariu opened issue #9686:

Project here

I'm evaluationg wasm + wasmtime for a query execution library, much of that involves calling iterators into rust to get data then executing dynamically generated logic via wasm.

The code here sums up an iterator by calling a rust function and doing the summing up in wasm

  1. is there a better way to measure the wasmtime execution time
  2. can this be made to run faster? If yes then how?

currently the run times seem to be

rust: 30ns
wasm: 21ms
python: 0.75s

view this post on Zulip Wasmtime GitHub notifications bot (Nov 26 2024 at 16:04):

alexcrichton commented on issue #9686:

At least for wasmtime you're measuring what's the fastest way. The Rust number probably isn't representative because it's probably constant-folded by LLVM which means it's not actually doing anything at runtime. The Wasm number shows an overhead of 4.2ns per call which is roughly what's expected. I'm not familiar with benchmarking Python so I don't know whether that's representative.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 16 2024 at 09:37):

fabianmurariu commented on issue #9686:

I'm considering using the memory instead, can a rust function be called from WASM and write something to memory that can then be accessed in WASM?

view this post on Zulip Wasmtime GitHub notifications bot (Dec 16 2024 at 15:55):

alexcrichton commented on issue #9686:

Yes, I'd recommend reading over the examples here


Last updated: Dec 23 2024 at 12:05 UTC