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
- is there a better way to measure the wasmtime execution time
- 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
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.
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?
alexcrichton commented on issue #9686:
Yes, I'd recommend reading over the examples here
Last updated: Dec 23 2024 at 12:05 UTC