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

GoTo Line has a pause after hitting "return" (due to colorization?) #3011

Closed
dsyme opened this issue May 9, 2017 · 12 comments
Closed

GoTo Line has a pause after hitting "return" (due to colorization?) #3011

dsyme opened this issue May 9, 2017 · 12 comments
Labels
Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. Regression

Comments

@dsyme
Copy link
Contributor

dsyme commented May 9, 2017

Repro steps

  1. Take a large file
  2. Use "Go to Line" (Ctrl-G) then type a number then hit return

Expected behavior

Goes to the line very fast, then colorizes

Actual behavior

Takes a while, I think it is colorizing the file. (Is it waiting for a semantic colorization? Or just slowly doing syntax colorization)

Known workarounds

Be patient and just wait

@vasily-kirichenko
Copy link
Contributor

I'm afraid we don't control this.

@dsyme
Copy link
Contributor Author

dsyme commented May 9, 2017

Yeah I was wondering. Maybe it is just incentive for us to make the appropriate colorizer faster, or submit a roslyn bug to delay colorization

@majocha
Copy link
Contributor

majocha commented May 9, 2017

I think something's not right on our side. For comparison open ProjectNode.cs in ProjectSystem.Base. Over 6k lines and go to line is instantaneous.

@vasily-kirichenko
Copy link
Contributor

vasily-kirichenko commented May 9, 2017

The only thing I can think is syntactic colorization, which is synchronous in Roslyn (for a reason I don't fully understand, something like "we made AddSyntacticClassificationsAsync async, but call in synchronously from UI thread because we expect it to be super fast, because it's just tokenizing after all). The problem is that we need to tokenize all lines above current one in order to keep proper lexer state, so, when you jump to line #10000 from line #1, 10K lines are tokenized, which is fast, but not lighting fast.

(that's how I see it, maybe I'm wrong)

@majocha
Copy link
Contributor

majocha commented May 9, 2017

I suspect it's the UI of that go to popup that blocks and stutters for some reason. Try making large jumps around the code by right clicking scrollbar and selecting "scroll here" and it's always snappy.

@vasily-kirichenko
Copy link
Contributor

My VFT is broken, see the latest issue. Cannot test.

@dsyme
Copy link
Contributor Author

dsyme commented May 9, 2017

The only thing I can think is syntactic colorization..

I think it must be that. If you go to the last line of a large file, it's slow. Then back to the top, and try again to the last line, and its fast. That strongly seems to indicate colorization.

@vasily-kirichenko
Copy link
Contributor

I reproduced it on tast.fs, it took about 2-3 seconds each time I went to line #5000. dotTrace shows this:

image

After about a minute this stopped happening and it jumped instantly (no CPU load were for all that time).

@dsyme dsyme added Tenet-Performance Regression Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels May 10, 2017
@dsyme
Copy link
Contributor Author

dsyme commented May 10, 2017

@vasily-kirichenko I can't see anything causal on the dotTrace info - can you? Thanks

@vasily-kirichenko
Copy link
Contributor

That's the problem :)

@cartermp
Copy link
Contributor

cc @Pilchie

@dsyme
Copy link
Contributor Author

dsyme commented May 13, 2018

I tried again and the pause seems much reduced now in large files. This is an old issue so closing

@dsyme dsyme closed this as completed May 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-API Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. Regression
Projects
None yet
Development

No branches or pull requests

4 participants