Skip to content

Commit 8bacd71

Browse files
committed
chore: fix benchmark to run against valid JSON
Fix #226
1 parent 99391e0 commit 8bacd71

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ It is also important to note that Thoth.Json solve a different problem than thes
1717
For most of the use cases, Thoth.Json should be fast enough, not everyone needs to parse JSON at the speed of light.
1818

1919
```text
20-
BenchmarkDotNet v0.14.0, macOS Sequoia 15.0.1 (24A348) [Darwin 24.0.0]
21-
Apple M1 Max, 1 CPU, 10 logical and 10 physical cores
22-
.NET SDK 8.0.401
23-
[Host] : .NET 8.0.8 (8.0.824.36612), Arm64 RyuJIT AdvSIMD DEBUG
24-
DefaultJob : .NET 8.0.8 (8.0.824.36612), Arm64 RyuJIT AdvSIMD
20+
BenchmarkDotNet v0.14.0, Arch Linux
21+
Intel Core i9-14900K, 1 CPU, 32 logical and 24 physical cores
22+
.NET SDK 8.0.413
23+
[Host] : .NET 8.0.19 (8.0.1925.36514), X64 RyuJIT AVX2 DEBUG
24+
DefaultJob : .NET 8.0.19 (8.0.1925.36514), X64 RyuJIT AVX2
2525
2626
2727
| Method | Mean | Error | StdDev | Ratio | RatioSD |
2828
|---------------------------- |-----------:|---------:|---------:|------:|--------:|
29-
| System.Text.Json | 499.1 ns | 1.03 ns | 0.96 ns | 1.00 | 0.00 |
30-
| Newtonsoft | 1,553.4 ns | 4.08 ns | 3.81 ns | 3.11 | 0.01 |
31-
| Thoth.Json.System.Text.Json | 4,330.8 ns | 20.67 ns | 19.33 ns | 8.68 | 0.04 |
32-
| Thoth.Json.Newtonsoft | 5,783.3 ns | 57.05 ns | 50.57 ns | 11.59 | 0.10 |
29+
| System.Text.Json | 524.5 ns | 2.25 ns | 2.11 ns | 1.00 | 0.01 |
30+
| Newtonsoft | 1,757.2 ns | 25.57 ns | 22.66 ns | 3.35 | 0.04 |
31+
| Thoth.Json.System.Text.Json | 3,173.4 ns | 14.25 ns | 12.63 ns | 6.05 | 0.03 |
32+
| Thoth.Json.Newtonsoft | 5,094.4 ns | 32.62 ns | 28.92 ns | 9.71 | 0.07 |
3333
```
3434

3535
## Blogs post

benchmarks/dotnet/Main.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ let userJson =
4343
"lastname": "Stormblessed",
4444
"email": "[email protected]",
4545
"age": 77,
46+
"cell": "(555)-555-5555",
47+
"phone": "(555)-555-5555",
4648
"dob": "1947-07-30T14:54:27.372Z",
4749
"picture": "https://randomuser.me/api/portraits/men/95.jpg"
4850
}"""

benchmarks/dotnet/packages.lock.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,13 @@
327327
"thoth.json.core": {
328328
"type": "Project",
329329
"dependencies": {
330-
"FSharp.Core": "[5.0.2, )",
331-
"Fable.Core": "[4.1.0, )"
330+
"FSharp.Core": "[5.0.2, )"
332331
}
333332
},
334333
"thoth.json.newtonsoft": {
335334
"type": "Project",
336335
"dependencies": {
337336
"FSharp.Core": "[5.0.2, )",
338-
"Fable.Core": "[4.1.0, )",
339337
"Newtonsoft.Json": "[13.0.1, )",
340338
"Thoth.Json.Core": "[1.0.0, )"
341339
}
@@ -344,17 +342,10 @@
344342
"type": "Project",
345343
"dependencies": {
346344
"FSharp.Core": "[5.0.2, )",
347-
"Fable.Core": "[4.1.0, )",
348345
"System.Text.Json": "[9.0.0, )",
349346
"Thoth.Json.Core": "[1.0.0, )"
350347
}
351348
},
352-
"Fable.Core": {
353-
"type": "CentralTransitive",
354-
"requested": "[4.1.0, )",
355-
"resolved": "4.1.0",
356-
"contentHash": "NISAbAVGEcvH2s+vHLSOCzh98xMYx4aIadWacQdWPcQLploxpSQXLEe9SeszUBhbHa73KMiKREsH4/W3q4A4iA=="
357-
},
358349
"Newtonsoft.Json": {
359350
"type": "CentralTransitive",
360351
"requested": "[13.0.1, )",

0 commit comments

Comments
 (0)