Thoth.Json.System.Text.Json
0.2.0
dotnet add package Thoth.Json.System.Text.Json --version 0.2.0
NuGet\Install-Package Thoth.Json.System.Text.Json -Version 0.2.0
<PackageReference Include="Thoth.Json.System.Text.Json" Version="0.2.0" />
paket add Thoth.Json.System.Text.Json --version 0.2.0
#r "nuget: Thoth.Json.System.Text.Json, 0.2.0"
// Install Thoth.Json.System.Text.Json as a Cake Addin #addin nuget:?package=Thoth.Json.System.Text.Json&version=0.2.0 // Install Thoth.Json.System.Text.Json as a Cake Tool #tool nuget:?package=Thoth.Json.System.Text.Json&version=0.2.0
Thoth.Json
Stable | Prerelease |
---|---|
Benchmark
Remark
We are comparing the performance of Thoth.Json with standard JSON libraries like Newtonsoft.Json and System.Text.Json.
Thoth.Json is expected to be slower than these libraries because it uses them internally.
It is also important to note that Thoth.Json solve a different problem than these libraries. It aims to provide a cross-platform API for .NET, JavaScript, Python, etc. with a focus on the developer experience and type safety.
For most of the use cases, Thoth.Json should be fast enough, not everyone needs to parse JSON at the speed of light.
BenchmarkDotNet v0.14.0, macOS Sequoia 15.0.1 (24A348) [Darwin 24.0.0]
Apple M1 Max, 1 CPU, 10 logical and 10 physical cores
.NET SDK 8.0.401
[Host] : .NET 8.0.8 (8.0.824.36612), Arm64 RyuJIT AdvSIMD DEBUG
DefaultJob : .NET 8.0.8 (8.0.824.36612), Arm64 RyuJIT AdvSIMD
| Method | Mean | Error | StdDev | Ratio | RatioSD |
|---------------------------- |-----------:|----------:|---------:|------:|--------:|
| Thoth.Json.Newtonsoft | 6,359.6 ns | 102.35 ns | 95.74 ns | 10.40 | 0.19 |
| Thoth.Json.System.Text.Json | 4,936.8 ns | 45.64 ns | 38.11 ns | 8.07 | 0.11 |
| Newtonsoft | 1,497.8 ns | 24.72 ns | 23.13 ns | 2.45 | 0.05 |
| System.Text.Json | 611.7 ns | 8.62 ns | 7.20 ns | 1.00 | 0.02 |
Blogs post
This is to keep track of different blog post that I refer to sometimes when thinking or helping people.
Project structure
Tests
For the tests, we use a shared project Thoth.Json.Tests
that is referenced by the different runners. This is because we want each runner to only have the minimum amount of dependencies, and also if we include files from outside the .fsproj
folder, then some generated files by Fable escape from the specify outDir
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Fable.Core (>= 4.1.0)
- Fable.Package.SDK (>= 1.0.0)
- FSharp.Core (>= 5.0.2)
- System.Text.Json (>= 9.0.0)
- Thoth.Json.Core (>= 0.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
### 🚀 Features
* *(perf)* Improve performance of `hasProperty` decoder helper ([5aa095c](https://github.com/thoth-org/Thoth.Json/commit/5aa095c12c7e8e2dc96e5ced30da6372a49064ec))
<strong><small>[View changes on Github](https://github.com/thoth-org/Thoth.Json/compare/2201241db185835eecd56c1cd4c3dadf251aa4df..2704233d4335f31370fce884568df852ea60878f)</small></strong>