emacs-lsp / emacs

Mirror of GNU Emacs
http://www.gnu.org/software/emacs/
GNU General Public License v3.0
71 stars 8 forks source link

Slow indexing of rust-analyzer on Apple Silicon #3

Closed gagbo closed 1 year ago

gagbo commented 1 year ago

Hi,

Still the same issue as pointed out on Discord:

Using:

when I open a rust project Rust-Analyzer starts, but it doesn't take all the resources at all, leading to a VERY (probably by a factor 10) slow initialization of the cache. See this screenshot of btop resource usage: Capture d’écran 2022-11-14 à 08 59 36

Opening the same project with vim spawns more threads on demand (peaks to 30 for this project) and uses all available CPU time (peaks to 100% all cores), leading to way faster indexing. I could not repro this on Linux, but I didn't try with this commit yet.

gagbo commented 1 year ago

(And emacs 28 upstream acts like vim, so there's a hidden regression somewhere in the fork :( )

ericdallo commented 1 year ago

Maybe related to https://github.com/emacs-lsp/emacs/issues/5 ?

gagbo commented 1 year ago

I think the issue is fixed after a rebase to emacs-29 (I'm testing https://github.com/gagbo/emacs/tree/json-rpc-29 which I'll rebase probably once a week or a fortnight). I have peak CPU usage, and the status in the modeline reported up to 8 compilation tasks in parallel when going into a Rust buffer, which is what I expected.

Capture d’écran 2022-12-08 à 10 02 44

Therefore I'm closing the issue.