Skip to content

Performance issue causing VS freezes and Out of memory crashes #1249

@blumu

Description

@blumu

NOTE: This reproes on a private solution so I cannot share unfortunately.

We encounter perf issues with our VS solution (hangs, and freezes). The F# team looked into perfview traces that we shared with them and have identified a performance issue in the FSharp.Data type provider causing the large object heap to be filled up, and eventually triggering long gen2 GC pauses (>30s).
The following perfview stack trace shows 6GB of memory related to assemblies being loaded for the type providers in FSharp.Data.
There is about 1GB for each type provider exposed by FSharp.Data, even though our solution only makes use of two of them (JSON, and XML).
image
(Visual Studio 2019 Preview 4.2 [28712.124.d16.0])

The proper fix might involve fixes to the TypeProvider SDK (ProvidedType.fs). (Will Smith submitted a PR to address this at fsprojects/FSharp.TypeProviders.SDK#283 but the proposed solution has drawbacks and was therefore not approved.)

  • Given the perf impact of this bug, it may be a good idea to consider having FSHarp.Data consume the patch version of ProvidedTypes.fs from Will Smith's PR.
  • Additionally, as a temporary mitigation, it would also be good to have FSHarp.Data only load the type providers that are consumed (in our cases, that's just XML and JSON but not WorldBank, CSV, and Html)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions