Join GitHub today
F# Type Provider slows down intellisense in Visual Studio 2017 #220
I have a very simple type provider; all types are erased, the provided type has 2000 int readonly properties Tag1..Tag2000
Then a test project with two modules in separate files:
Everything works as expected (tests execution included). The problem I have is with the design time behavior inside Visual Studio, while I write code. I expect to have some overhead due to the type provider, but the slowness seems frankly excessive. The times reported below are in seconds and refer to the time measured from pushing the dot (.) key until the intellisense property list appears on the screen
If I comment out or remove the first test code lines (so to eliminate any references to the provided stuff), then I get
If the number of properties is greater, the time seems to increase exponentially, not linearly, so that at 10000 it becomes minutes.
If someone is curious about why I need so many properties, I am trying to supply an instrument to data analysts so that they can write F# scripts and get data out of an historian database with more than 10000 tags in its schema.
@francotiveron Was your type provider in a .NET SDK-style (new-style) project, like this used in "examples" in this SDK? A bad bug in performance of .NET SDK-style proects has recently been fixed which may be relevant here - basically all .NET SDK-style projects were being re-typechecked on every key press. @TIHan did the fix. IIRC the fix will be in Visual Studio 15..x or 15.8
I also did a quick profiling run to see if anything specific in the autocomplete or TPSDK implementation stands out. Here are the top ones:
added a commit
May 24, 2018
@francotiveron There is definitely quadratic behaviour here, I can see at least one source of it, where