Closed Thorium closed 10 months ago
I tried to change those DUs to structs (https://github.com/fsprojects/FSharp.TypeProviders.SDK/compare/master...Thorium:FSharp.TypeProviders.StarterPack:more-structs), and run some memory & performance analysis with some type-providers and VS, but the difference was within mean square error margin. So no justification for the change.
This is not so much of an issue, but just a maintenance question...
The Utils module has lot of stuff that I think is pre-ValueOption and UOption could be replaced with VOption. https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/src/ProvidedTypes.fs#L36
I think the utils themselves could also benefit of Spans, for example: https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/src/ProvidedTypes.fs#L55 ...could work something like:
I would also like to make the DUs without any fields (or only fields of plain non-recursive other DUs) as structs, e.g. here: https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/src/ProvidedTypes.fs#L2737 https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/src/ProvidedTypes.fs#L2952 https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/src/ProvidedTypes.fs#L2973
Why do I even care, is because with a bigger F# solution with multiple type-providers they end-up taking quite a bit of resources, making VS a bit slow, for example this is a part of memory snapshot of VS2022: