3
votes

Using XMLProvider from the FSharp.Data package like:

type internal MyProvider = XmlProvider<Sample = "C:\test.xml">

The test.xml file contains a total of 151,838 lines which makes up 15 types.

Working in the same project as the type declaration MyProvider is a pain, as it seems the XmlProvider is triggered everytime I hit CTRL+SPACE (Edit.CompleteWord) - and therefore regenerates all the models, which can take up to 10sec.

Is there any known work around, or setting to cache the generated models from XmlProvider?

1
I'm afraid we do not have any caching mechanism for the inferred schema - but it sounds like something that should not be too hard to add - open a GitHub issue if you'd be interested in contributing. Aside from that, I guess simplifying the sample XML is (currently) the only way to address this. - Tomas Petricek
@TomasPetricek, Thanks. Could you please make your comment an answer, so that I can accept it? :-) - ebb
Thanks, answer posted... - Tomas Petricek

1 Answers

1
votes

I'm afraid F# Data does not currently have any caching mechanism for the inferred schema. It sounds like something that should not be too hard to add - if anyone is interested in contributing, please open an issue on GitHub to start the discussion!

My recommendation for the time being would be to try to simplify the sample XML, so that it is shorter and contains just a few representative records of all the different kinds.