Open majocha opened 1 year ago
It's expected to have multiple builders per project under some circumstances. Notably when any references are updated.
There's also a lot going on with FSharpProjectOptions
processing on VS startup, which could possibly also generate multiple options for one project which are not AreSameForChecking
and thus would produce multiple builders.
I wonder what's going on here:
when builderOpt.IsNone -> return builderOpt
does not feel right or intended.
It's expected to have multiple builders per project under some circumstances. Notably when any references are updated.
There's also a lot going on with
FSharpProjectOptions
processing on VS startup, which could possibly also generate multiple options for one project which are notAreSameForChecking
and thus would produce multiple builders.
The problem I've seen is not only them being created but both running to completion, parsing and typechecking everything twice. This however seem to happen in VS only for the first file opened, and not the subsequent ones.
So it's more of a glitch than a showstopper after all 😀
I've also seen VS not cancelling the type check when it should. For example closing the solution will not stop the type check. If the project options update a few times during solution load, and in the meantime some analyzers are being run on the opened documents, and they don't cancel on project options change, we would see multiple typechecks running in parallel on the same files. That's what I sometimes observe.
I think I could've seen it in Rider too some time ago. It's OK if there are multiple builders for the same project given that the options are different (e.g. different target frameworks, or before/after a project modifications), but it seems that there should be no builders that have the same options, I'd expect them to be shared in such a case.
So regarding this one - I have spent some time on it today, compiling the compiler and looking into what's happening in the language service.
I didn't really notice something sensational there, especially in the light of comments above. Multiple builders are spun up sometimes, but there could be legitimate reasons for that and it doesn't seem like it's getting "out of control".
Given extra information in the comments (if this happens then probably only on the startup) and low activity here for the last year, I'd deprioritize this a bit and wait for a solid repro - i.e. some particular code which spins up something that it shouldn't.
@vzarytovskii
(discussed offline, agreed on the above)
This causes wasted CPU work and multiplied allocations. It does not seem intentional.