When I try to use tokio to scale wasmtime horizontally, I found that wasmtime performance drops significantly. It looks like there are some shared resources inside. And no matter how many threads I open, the total number of execute num is almost the same. This is my performance data:
| thread and task |
data |
total execute nums |
| thread 1, task 1 |
11w/task |
11w |
| thread 3, task 3 |
4w/task |
12w |
| thread 8, task 8 |
1w/task |
8w |
This is my test code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=e9fc13a7d68b80afdc07076482a5b787 .
And the wasm code is just a function return 1.
package main
//export echo
func echo(ctxLen, reqLen int32) int32 { //nolint
return 1
}
func main() {
}
When I try to use tokio to scale wasmtime horizontally, I found that wasmtime performance drops significantly. It looks like there are some shared resources inside. And no matter how many threads I open, the total number of execute num is almost the same. This is my performance data:
This is my test code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=e9fc13a7d68b80afdc07076482a5b787 .
And the wasm code is just a function return 1.