-
Notifications
You must be signed in to change notification settings - Fork 830
Open
Labels
Milestone
Description
Experimental graph-based checking in compilation has some opportunities for performance improvements.
One of them is the below code invoked for each file when making the graph:
fsharp/src/Compiler/Driver/GraphChecking/DependencyResolution.fs
Lines 215 to 217 in 9c55d32
| let implicitDepIdx = | |
| files | |
| |> Array.tryFindIndex (fun f -> FileSystemUtils.fileNameOfPath f.FileName = filename) |
The
fileNameOfPath checks for illegal characters in a very inefficient way, and besides, we should only have to do it once, instead of doing it once per each file node we're creating.
Here is a snapshot showing the graph construction part of compilation when GraphBasedChecking is enabled:

Another low-hanging fruit is the memoization where we hash FSharpLists which looks expensive:

Another less important one is here:
fsharp/src/Compiler/Driver/GraphChecking/DependencyResolution.fs
Lines 97 to 98 in 9c55d32
| (stateAfterFullIdentifier, state.OpenNamespaces) | |
| ||> Set.fold (fun acc openNS -> processIdentifier queryTrie [ yield! openNS; yield! path ] acc)) |
This issue is to track this work. I'm happy to submit a PR at some point.
rstm-sf
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New