dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.91k stars 785 forks source link

15.3 preview 3: error highlighting updates in 5-6 seconds #3278

Closed vasily-kirichenko closed 6 years ago

vasily-kirichenko commented 7 years ago

Everything is updated with a huge delay, especially error squiggles. Such a feedback is completely useless while you typing code:

1

Can the Roslyn team just provide two simple options:

?

I understand that they've made a research and honestly trust that such a behavior is great, but it does not work for F#.

vasily-kirichenko commented 7 years ago

yeah, everything is so awful, that I cannot use it at all. Back to VS 2015.

dsyme commented 7 years ago

@vasily-kirichenko I believe that 15.3 preview 3 doesn't contain the necessary fixes. Use the nightly or master

dsyme commented 7 years ago

I'm seeing < 1sec red squiglly update on master.

dsyme commented 7 years ago

(Note I don't know if nightly can be used with 15.3, I'm using it with 15.2)

dsyme commented 7 years ago

@vasily-kirichenko Relevant fixes were https://github.com/Microsoft/visualfsharp/pull/3238 and #3270

I'll close this since it is fixed. For production coding I'd use 15.2 + (nightly or master) today

vasily-kirichenko commented 7 years ago

Nightly VSIX + 15.3 preview 3: 3-4 seconds. Still slow. If you think it's fast enough, ok.

vasily-kirichenko commented 7 years ago

This is how it should work:

1

dsyme commented 7 years ago

If you think it's fast enough, ok.

3-4 seconds is not fast enough. With 15.2 + master I am seeing < 1 second on small scripts, which is fast enough (though faster is always better). We should determine if this is a difference in

  1. 15.2 --> 15.3
  2. master v. nightly
  3. your machine and my machine

on an exact repro case

dsyme commented 7 years ago

@vasily-kirichenko Do you have a 15.2 install available?

vasily-kirichenko commented 7 years ago

Yes. Just installed the nighties:

image

  1. Open folder
  2. Select any folder
  3. Create a script file
  4. Put the following code into it
[<AllowNullLiteral>]
type Test = class end

let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
let _: Test = null
  1. Close it, then reopen since otherwise nothing works
  2. Result

1

vasily-kirichenko commented 7 years ago

My machine is pretty fast (i7 4GHz).

vasily-kirichenko commented 7 years ago

VS Code is also slow (only ~2 times faster than VS), Atom is fast:

1

So the problem in VS, not in FCS.

dsyme commented 7 years ago

Looking at your screenshot https://github.com/Microsoft/visualfsharp/issues/3278#issuecomment-312000055 it seems between 2-3.5 seconds. (3.5 when you add the character, 2 when you remove)

cartermp commented 7 years ago

I see ~2 seconds on my machine, but it's clear that that ~2 seconds is taken up mostly by the artificial delay.

dsyme commented 7 years ago

There's another usability factor here we should keep an eye on, which is timing consistency

User studies of various things have shown that variable response time (say 1s - 10s) can be even less productive than a fixed, consistent response time well above the average of the variable response time. People basically get used to a particular response time and are productive if it is consistent (and will be even more productive if it is even faster).

TBH I think our response times are pretty inconsistent, though when working only within one file they are probably fairly ok

vasily-kirichenko commented 7 years ago

Today's released Rider beta:

1

saul commented 7 years ago

It's clearly an artificial delay - the fact that the semantic highlighting changes quickly shows that we're parsing fast enough. I believe @CyrusNajmabadi knows about these delays and can probably affect some change into how much of a delay we have on our error squiggles. Also IIRC I think one of the other Roslyn devs said that we shouldn't be using document analyzers for our error reporting anyway? I was under the impression only F# does it that way.

vasily-kirichenko commented 7 years ago

@saul what we should use then?

saul commented 7 years ago

I'm not sure - I can't remember exactly what was suggested. Let me check my emails

dsyme commented 7 years ago

Please don't leave these discussions about delays to guesswork. The exact timings of FCS activities involved can now be seen in traces like this: https://github.com/Microsoft/visualfsharp/issues/3094#issuecomment-310230014. They now include a lot of causal information, so it's very easy to see the pauses.

Just connect a debugger to devenv.exe, capture a trace of logging for an activity, paste it in a gist, analyze it,

dsyme commented 7 years ago

Also, please make sure you're using master on 15.2. (It's possible the Roslyn-related timings have changed in 15.3, but we don't have a good way of running master reliably on 15.3 yet)

dsyme commented 7 years ago

@vasily-kirichenko Are you still seeing these long times? I'd like to close this as the update times on my machine are fast (at least, when all else is working :) )

vasily-kirichenko commented 7 years ago

Yes, it seems working fast on small files, on large ones it's constrained by FCS.

dsyme commented 7 years ago

@vasily-kirichenko Super, thanks for checking

vasily-kirichenko commented 7 years ago

Sorry, I was wrong, it still takes about 4-5 seconds to update:

1

This file belongs to a really tiny project (3 source files, 200 lines of code), which is a part of a large solution (> 100 F# project).

On a hello world project (and a solution that contains this project only), it works about twice as fast:

1

Compare to Rider:

1

IMHO this is how it should work.

saul commented 7 years ago

@vasily-kirichenko It's worth trying setting highPriority=true here and seeing if it makes a difference:

https://github.com/Microsoft/visualfsharp/blob/86fcbe34761a820be6e906370e26e342d5252c89/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs#L70

dsyme commented 7 years ago

@saul I think we've looked into it and it doesn't make much difference

@vasily-kirichenko I measure 3.0-4.5 seconds from your screen shot. I think that's roughly where we've been at historically with VS2015, maybe a little slower reaction time.

I'm not sure of Rider's approach to using FCS, but it's possible their approach may not be entirely sustainable, or may have other tradeoffs. But I agree it's very nice and immediate for these samples.

vasily-kirichenko commented 7 years ago

I've tried highPriority=true, no difference.

vasily-kirichenko commented 6 years ago

Errors highlighting apparently works ok, I'm closing it.

saul commented 6 years ago

Can we re-open this please? It hasn’t been resolved

vasily-kirichenko commented 6 years ago

@saul Still not resolved?

cartermp commented 6 years ago

With 15.7.x the consistency issue should be resolved, now that the error diagnostics analyzer is always run first. I see consistent 1-2 seconds, which although it could be improved, is at least consistent unlike before.

dsyme commented 6 years ago

@cartermp OK, I think this should be closed then

cartermp commented 6 years ago

Closing (since I apparently never bothered to do that...)