Design doc on reusing typechecking results
The design for #17260.
:white_check_mark: No release notes required
@psfinaki Thanks for starting this initiative, this may noticeably improve things!
I can add two things to consider:
-
Reusing type check info when non-F# projects are referenced
Rider and Visual Studio both produce in-memory metadata for referenced C#/VB.NET projects. The approaches are different, but some of the issues should be similar. FCS uses in-memory metadata timestamp which depends on the project files, while fsc uses project output assembly timestamp. These two timestamps are likely to differ the most of the time, which would prevent us from reusing cached type check data for referencing F# projects. It would be nice if we found a way to reuse type check info when non-F# projects are referenced.
-
Different conditional compilation between FCS in Rider and fsc
We use
--noconditionalerasureflag to properly analyze erased symbols in the tooling. When type check caches are reused we should not have such difference between typed trees. I propose we change the erasure logic here: we should always keep these symbols in the typed trees and erase them later during IL generation instead.
@vzarytovskii @T-Gro I updated the implementation plan as per our discussion last week - see if things make sense now.
I think at least the first stage was something more or less set, so I will gradually start tinkering with it.