fsprojects / FSharp.TypeProviders.SDK

The SDK for creating F# type providers
https://fsprojects.github.io/FSharp.TypeProviders.SDK/
MIT License
298 stars 94 forks source link

Determining FSharp.Core version allocates large arrays on the large object heap #287

Open cartermp opened 5 years ago

cartermp commented 5 years ago

From here: https://github.com/Microsoft/visualfsharp/issues/5930#issuecomment-452199963

The following code ends up reading all of FSharp.Core.dll and one of mscorlib.dll/system.runtime.dll/netstandard.dll into byte arrays upon type provider instantiation:

https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/6d90bfc8a6385ba2ab0319d4c08620aafc207803/src/ProvidedTypes.fs#L8572-L8608

This work is unnecessary because the F# compiler already knows this information. However, changing this would require work both in here and the compiler. Perhaps there's a cheaper way than allocating multiple MB on the LOH?