rust-lang / rust-mode

Emacs configuration for Rust
Apache License 2.0
1.1k stars 178 forks source link

really slow on not formatted (generated) files #378

Closed Dushistov closed 4 years ago

Dushistov commented 4 years ago

If open rust file in attachment (generated by bindgen from C header file) and run M-x end-of-buffer, the emacs hangs on my machine with 16 cores CPU ~ 4GHz with 32GB of RAM.

GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29 rust-mode 20200513.812

header.zip

mookid commented 4 years ago

This is a bad case for emacs in general with the super long lines. I don't see a huge difference between fundamental-mode and rust-mode: do you? I does not hang durably my machine.

Also, if you generate the code, you might just consider something like sed 's%;%;\n%g' and the resulting file has no problem.