fsprojects / FSharp.Data

F# Data: Library for Data Access
https://fsprojects.github.io/FSharp.Data
Other
814 stars 288 forks source link

System.Text.Json for JsonProvider? #1498

Closed Thorium closed 10 months ago

Thorium commented 10 months ago

Hi,

I created a package of https://github.com/Thorium/FSharp.Data.JsonProvider.Serializer (and Nuget https://www.nuget.org/packages/FSharp.Data.JsonProvider.Serializer)

...which you can use to speed-up your current FSharp.Data Json Serialization.

This will keep existing JSON domain model and everything as is, just provide alternative "from text" and "to text" options, with burden of extra dependency to System.Text.Json. We don't want that probably for all TPs, that's why the dependency is reverse here: This package uses FSharp.Data and not the other way.

If you want the source-code can be transferred under FSharp.Data repository. (Source code is tiny, it's just about transfering the FSharp.Data.JsonProvider DOM to System.Text.Json DOM and vice versa.

More conversation an motivations pondered at this issue https://github.com/fsprojects/FSharp.Data/issues/1478

Thorium commented 10 months ago

Even though the serialization speed is 50% faster that way, we are talking about around 0.1s so the raw FSharp.Data is good enough on most scenarios.