Created
June 18, 2020 17:46
-
-
Save Tarmil/88634832d0496be34a820123063e6e6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Text.Json | |
open System.Text.Json.Serialization | |
open BenchmarkDotNet.Attributes | |
open BenchmarkDotNet.Running | |
type MyRecord = | |
{ | |
x: int | |
y: string | |
} | |
type Records() = | |
let o = JsonSerializerOptions() | |
do o.Converters.Add(JsonFSharpConverter()) | |
let r = { x = 1; y = "a" } | |
[<Benchmark>] | |
member _.BoleroJson() = Bolero.Json.Serialize(r) | |
[<Benchmark>] | |
member _.SystemTextJson() = JsonSerializer.Serialize(r, o) | |
[<EntryPoint>] | |
let main argv = | |
BenchmarkRunner.Run<Records>() |> ignore | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment