Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have 600 lexer-stage errors and VS Code/RA cannot keep up #3782

Closed
djc opened this issue Mar 31, 2020 · 11 comments
Closed

I have 600 lexer-stage errors and VS Code/RA cannot keep up #3782

djc opened this issue Mar 31, 2020 · 11 comments
Labels
A-diagnostics diagnostics / error reporting A-perf performance issues S-actionable Someone could pick this issue up and work on it right now

Comments

@djc
Copy link

djc commented Mar 31, 2020

It appears like RA tries to process every edit before re-analyzing, but then takes longer to re-analyze than I need to do the next edit. (Current first error: "Syntax Error: expected COMMA".)

@kjeremy
Copy link
Contributor

kjeremy commented Mar 31, 2020

What's your environment?

@djc
Copy link
Author

djc commented Mar 31, 2020

MacBook Pro running macOS 10.15.3 with 6-core 2.2 GHz i7 and 32 GB RAM, running stable Rust.

@kjeremy
Copy link
Contributor

kjeremy commented Mar 31, 2020

Vscode, version of rust analyzer?

@djc
Copy link
Author

djc commented Mar 31, 2020

Ah, sorry -- I have VS Code 1.43.2 and RA 0.2.108.

@djc
Copy link
Author

djc commented Mar 31, 2020

(BTW, the lag introduced on pressing the Enter key is especially annoying in this kind of scenario.)

@kjeremy
Copy link
Contributor

kjeremy commented Mar 31, 2020

Do you have enhanced typing enabled? You may want to disable that and see how it goes. A reproducible project would be great.

@Veetaha
Copy link
Contributor

Veetaha commented Mar 31, 2020

This might be the related case reported in zulip:
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Analyzer.20being.20super-slow.20on.20nightly/near/192127028

@djc do you observe the 100% single CPU core load when this happens?

@djc
Copy link
Author

djc commented Apr 1, 2020

The code was somewhat similar to this (I've recreated this from what I had originally):

https://github.com/djc/tokio-imap/blob/ra-sloooow/imap-proto/src/parser/rfc3501/mod.rs

I was refactoring nom parsers from macro-style to function-style, starting from a replace of !( to (. The do_parse!() macro in particular has some funky syntax going on. I'm on a different machine now with a 2,3 GHz 8-Core Intel Core i9, so the performance is much better (not getting 100% CPU on any of this machine's cores), but I'm still seeing similar issues. Would not be surprised if I had 100% CPU on the work laptop.

What is enhanced typing exactly? I can't find it in the settings.

@kjeremy
Copy link
Contributor

kjeremy commented Apr 1, 2020 via email

@lnicola
Copy link
Member

lnicola commented Jan 26, 2021

Enhanced typing is now disabled by default and we limit the number of errors returned to the client.

@djc are you still seeing this?

(Marking S-actionable, if you look at this in the future and the OP hasn't answered, ping me so we can close it).

@lnicola lnicola added A-diagnostics diagnostics / error reporting A-perf performance issues S-actionable Someone could pick this issue up and work on it right now labels Jan 26, 2021
@djc
Copy link
Author

djc commented Mar 3, 2021

I did some spot checking against the old branch and it does look like this is fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting A-perf performance issues S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

4 participants