Skip to content

Commit 827ee64

Browse files
michaelglassclaude
andcommitted
Parallel per-file type checking with concurrent project check
Run ParseAndCheckProject and per-file ParseAndCheckFileInProject concurrently. The project check warms the FCS incremental builder; parallel per-file checks share the builder and benefit from its warmed state. Benchmarked on a 24-file project: ~133s sequential to ~18s parallel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 115db40 commit 827ee64

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

  • src/FSharpLint.Core/Application

src/FSharpLint.Core/Application/Lint.fs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,21 @@ module Lint =
468468

469469
let filesToLint = files |> List.filter (not << isIgnoredFile)
470470

471-
let! projectCheckResults = checker.ParseAndCheckProject projectOptions
472-
473-
let! parsedFiles =
471+
// Run project check and per-file parse+check concurrently.
472+
// The project check warms the FCS incremental builder; parallel
473+
// per-file checks share the builder and benefit from its warmed state.
474+
let projectCheckAsync = checker.ParseAndCheckProject projectOptions
475+
let perFileAsync =
474476
filesToLint
475477
|> List.map (fun file -> ParseFile.parseFile file checker (Some projectOptions))
476-
|> Async.Sequential
478+
|> Async.Parallel
479+
480+
let! results = Async.Parallel [|
481+
async { let! r = projectCheckAsync in return box r }
482+
async { let! r = perFileAsync in return box r }
483+
|]
484+
let projectCheckResults = results.[0] :?> FSharpCheckProjectResults
485+
let parsedFiles = results.[1] :?> ParseFile.ParseFileResult<ParseFile.FileParseInfo>[]
477486

478487
let failedFiles = Array.choose getFailedFiles parsedFiles
479488

0 commit comments

Comments
 (0)