Let FSharpProjectSnapshot.FromOptions take reference stamps from the host - #20459
Open
xperiandri wants to merge 1 commit into
Open
Let FSharpProjectSnapshot.FromOptions take reference stamps from the host#20459xperiandri wants to merge 1 commit into
FSharpProjectSnapshot.FromOptions take reference stamps from the host#20459xperiandri wants to merge 1 commit into
Conversation
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
xperiandri
force-pushed
the
perf/snapshot-reference-stamps
branch
from
September 6, 2026 04:08
268d203 to
c75a5bd
Compare
3 tasks
FSharpProjectSnapshot.FromOptions take reference stamps from the host
FSharpProjectSnapshot.FromOptions stats every -r: reference each time a snapshot is built from options; under the transparent compiler in Visual Studio that is every from-scratch snapshot after an options recompute. A host that already tracks the last-write times of its references can pass getReferenceStamp instead; the default stays FileSystem.GetLastWriteTimeShim. The callback is threaded through the recursive call for referenced F# projects. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
xperiandri
force-pushed
the
perf/snapshot-reference-stamps
branch
from
September 6, 2026 04:35
c75a5bd to
dab34ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
FSharpProjectSnapshot.FromOptionsstats every-r:reference (FileSystem.GetLastWriteTimeShim) each time a snapshot is built from options. Under the transparent compiler in Visual Studio that is the from-scratch path for every new RoslynProjectinstance whose options are not reusable — after every options recompute, sinceFSharpProjectOptions.AreSameForCheckingcompares only theStamp— so a project with a few hundred references pays a few hundred stats per typecheck request.This adds an optional
getReferenceStamp: string -> DateTimetoFromOptions. A host that already tracks the last-write times of its references (#20457 keeps them behind anIVsAsyncFileChangeEx2watcher) supplies them; everyone else gets the sameFileSystem.GetLastWriteTimeShimas before. The callback is threaded through the recursive call forFSharpReferencedProject.FSharpReference, so referenced projects' snapshots use it too.No behaviour change for existing callers; the surface-area baseline gains the new optional parameter on the existing overload.
Checklist
FSharpChecker/ProjectSnapshot.fs: the stamps of both the project and its referenced F# project come from the callback.docs/release-notes/.FSharp.Compiler.Service/11.0.100.md.