The problem is that rust-analyzer consumes much more memory than it has used to and also very often get stuck and shows incorrect warnings and won't finish analysis of the crate and therefore is pretty much unusable for the project. I noticed a very similar behavior of rust-analyzer in the https://github.com/bytecodealliance/wasm-tools repository.
After some backtracking I found that the performance regressions started after merging these PRs:
What do the PRs do?
They refactor use of wasmparser's for_each_operator macro which is supposed to be used as tt-muncher macro in order to perform operations on the over 500 different Wasm operators.
My best guess at what portion of wasmi causes the choking for rust-analyzer is probably these code segments:
Sometimes I succeed in getting rust-analyzer unstuck by performing a cargo clean on my workspace. However, this is notably not a very neat solution for obvious reasons.
I recently noticed a big performance degradation regarding
rust-analyzer
in one of my projects: https://github.com/paritytech/wasmiThe problem is that
rust-analyzer
consumes much more memory than it has used to and also very often get stuck and shows incorrect warnings and won't finish analysis of the crate and therefore is pretty much unusable for the project. I noticed a very similar behavior ofrust-analyzer
in the https://github.com/bytecodealliance/wasm-tools repository.After some backtracking I found that the performance regressions started after merging these PRs:
What do the PRs do? They refactor use of
wasmparser
'sfor_each_operator
macro which is supposed to be used as tt-muncher macro in order to perform operations on the over 500 different Wasm operators.My best guess at what portion of
wasmi
causes the choking forrust-analyzer
is probably these code segments:Note that in particular in https://github.com/paritytech/wasmi/pull/645 we had to increase macro recursion limit in
lib.rs
:Sometimes I succeed in getting
rust-analyzer
unstuck by performing acargo clean
on my workspace. However, this is notably not a very neat solution for obvious reasons.