radian-software / radian

🍉 Dotfiles that marry elegance and practicality.
MIT License
495 stars 47 forks source link

rust mode is unbearably slow #392

Closed redpanda1234 closed 6 years ago

redpanda1234 commented 6 years ago

Occasionally have to wait more than half a second for keypresses to register. Not quite sure what the issue is.

raxod502 commented 6 years ago

Try disabling eldoc-mode and/or company-mode and/or racer-mode, and seeing which is the problem.

redpanda1234 commented 6 years ago

Seems that racer-mode is the main bottleneck. Toggling eldoc-mode and company-mode appear (?) to cause small performance hits, but racer-mode I think is what really kills it.

raxod502 commented 6 years ago

That's what I figured. Try

$ emacs -nw -Q -l ~/.emacs.d/straight/bootstrap.el

and M-x straight-use-package RET racer RET, find a Rust file, M-x racer-mode and see if you can reproduce the lag. You may also need to install company. If you can reproduce it in vanilla Emacs, then I would recommend reporting the issue upstream; otherwise, try to bisect. I probably won't have time to debug for a while.

redpanda1234 commented 6 years ago

Additionally: C-s occasionally freezes emacs for >5 seconds.

redpanda1234 commented 6 years ago
screen shot 2017-12-03 at 8 35 42 pm
raxod502 commented 6 years ago

It looks like the bottleneck is adaptive-wrap-prefix-mode. You could turn that off in rust-mode, or submit an issue upstream.

I'm not entirely convinced that adaptive-wrap-prefix-mode is even that useful. I might want to just get rid of it entirely.

redpanda1234 commented 6 years ago

All-around performance is substantially improved after disabling adaptive-wrap-prefix-mode.