You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get an open declaration (which is now available as a property in FSharpFileCheckResults and presented as FSharpEntity [])
check if any of symbols defined in each of the modules / namespaces above is used in the scope this particular open declaration is open
Currently I call FSharpEntity.MembersFunctionsAndValues for each namespace/module and it's the bottleneck - on middle sized files the analyzer takes several seconds to finish, on TypeChecker.fs it takes ~2 minutes, which is too slow.
So I'm trying to use different approach: get enclosing entity of each symbol uses and check if it corresponds to a module/ns from open declarations, which eliminates calling MembersFunctionsAndValues entirely. Unfortunately, only values, functions and members have EnclosingEntity (that is, modules for my purpose). I need this property for FSharpEntity too.
This approach is indeed a lot faster. Ignoring FSharpEntity and checking only vals and functions via EnclosingEntity processes TypeChecker.fs in 4 seconds, smaller files in tens of milliseconds.
Yes, it's not there because of a bit of a flaw in the TAST. I've put it on my TODO list to try to root this problem out. We will need it for other reasons too
@auduchinok I managed to improve the performance of unused opens dotnet/fsharp#4497 without implementing this. I'd still like to get it implemented though, it would make things simpler and faster
@dsyme I've checked the new unused opens implementation and it's indeed works much faster on an average solution/files, however getting children of something like JetBrains.Util still looks to take longer than a small file type check. The good news is tweaking unused imports to use the new DeclaredEntity made performance great on this file.
I'm looking into opening a PR with usage of DeclaredEntity, but will try to fix dotnet/fsharp#4658 first.
Activity
dsyme commentedon Oct 25, 2017
Yes, it's not there because of a bit of a flaw in the TAST. I've put it on my TODO list to try to root this problem out. We will need it for other reasons too
vasily-kirichenko commentedon Oct 25, 2017
Thanks a lot!
[-]Provide FSharpEntity.EncrosingEntity[/-][+]Provide FSharpEntity.EnclosingEntity[/+]dsyme commentedon Mar 12, 2018
@auduchinok I managed to improve the performance of unused opens dotnet/fsharp#4497 without implementing this. I'd still like to get it implemented though, it would make things simpler and faster
auduchinok commentedon Apr 1, 2018
@dsyme I've checked the new unused opens implementation and it's indeed works much faster on an average solution/files, however getting children of something like
JetBrains.Utilstill looks to take longer than a small file type check. The good news is tweaking unused imports to use the newDeclaredEntitymade performance great on this file.I'm looking into opening a PR with usage of DeclaredEntity, but will try to fix dotnet/fsharp#4658 first.