Skip to content

Conversation

@Thorium
Copy link
Member

@Thorium Thorium commented Aug 31, 2025

This is re-implementation of #68 with little bit smaller change set this time.
All tests pass, but I don't know how good is the current test-coverage.

Meanwhile it's not magic, it does cut some execution time, here are the results from this PR dbarbashov#1

BenchmarkDotNet v0.15.2, Windows 11 (10.0.26100.5074/24H2/2024Update/HudsonValley)
13th Gen Intel Core i9-13900H 2.60GHz, 1 CPU, 20 logical and 14 physical cores
.NET SDK 9.0.304
[Host] : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2 DEBUG
DefaultJob : .NET 9.0.8 (9.0.825.36511), X64 RyuJIT AVX2

  1. BoxedArrayRoundtrip
Method Mean Error StdDev Gen0 Gen1 Allocated Version
Newtonsoft.Json 2.127 us 0.0412 us 0.0491 us 0.8850 0.0114 10.86 KB 13.0.1
FSharp.Json 6.076 us 0.0505 us 0.0448 us 0.9460 0.0076 11.63 KB master
FSharp.Json 4.340 us 0.0398 us 0.0372 us 0.9384 0.0076 11.53 KB this-PR
  1. FSharpBinaryRoundtrip
Method Mean Error StdDev Gen0 Gen1 Gen2 Allocated Version
Newtonsoft.Json 13.04 ms 0.211 ms 0.197 ms 1484.3750 984.3750 125.0000 17.92 MB 13.0.1
FSharp.Json 49.42 ms 0.461 ms 0.408 ms 2700.0000 500.0000 - 33.27 MB master
FSharp.Json 47.87 ms 0.203 ms 0.180 ms 2800.0000 400.0000 - 33.73 MB this-PR
  1. FSharpListRoundtrip
Method Mean Error StdDev Gen0 Gen1 Allocated Version
Newtonsoft.Json 52.50 us 1.002 us 1.029 us 7.9346 0.4883 97.55 KB 13.0.1
FSharp.Json 376.12 us 3.696 us 3.457 us 64.9414 10.7422 798.8 KB master
FSharp.Json 322.84 us 2.010 us 1.678 us 63.4766 12.2070 783.17 KB this-PR
  1. LargeTupleRoundtrip
Method Mean Error StdDev Gen0 Gen1 Allocated Version
Newtonsoft.Json 4.137 us 0.0702 us 0.0657 us 1.0834 0.0229 13.29 KB 13.0.1
FSharp.Json 11.809 us 0.2158 us 0.1913 us 1.5869 - 19.82 KB master
FSharp.Json 9.760 us 0.1667 us 0.1559 us 1.5869 - 19.63 KB this-PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant