Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Rust example is an order of magnitude slower than wasmtime binary #17

Closed
tomasol opened this issue Jan 30, 2020 · 2 comments
Closed

Rust example is an order of magnitude slower than wasmtime binary #17

tomasol opened this issue Jan 30, 2020 · 2 comments

Comments

@tomasol
Copy link

tomasol commented Jan 30, 2020

time wasmtime markdown.wasm --invoke render "# Hello"
warning: using `--invoke` with a function that takes arguments is experimental and may break in the future
warning: using `--invoke` with a function that returns values is experimental and may break in the future
<h1>Hello</h1>


real    0m0.041s
user    0m0.039s
sys     0m0.005s

Rust:

time ./target/release/markdown 
Loaded in 475 ms
Rendered <h1>Hello, Rust!</h1>
 in 1 ms

real    0m0.484s
user    0m1.674s
sys     0m0.040s

I have added a stopwatch around load_file and render method. What could be the issue?

@tomasol
Copy link
Author

tomasol commented Feb 2, 2020

Passing --disable-cache to wasmtime binary only accounts for 100-150ms:

time wasmtime --disable-cache ./pkg/markdown.wasm --invoke render "# hello"
warning: using `--invoke` with a function that takes arguments is experimental and may break in the future
warning: using `--invoke` with a function that returns values is experimental and may break in the future
<h1>hello</h1>


real    0m0.161s
user    0m0.431s
sys     0m0.024s

@alexcrichton
Copy link
Member

I'm going to now that we've temporarily removed interface types support, but stay tuned to bytecodealliance/wasmtime#677 for future updates!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants