Skip to content

Commit

Permalink
Remove the benchmark from the readme as it is not up to date.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexaka1 committed Aug 27, 2024
1 parent 219443c commit 1701d14
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,4 @@ The `Utf8JsonFormatter` constructor accepts the following options:

# Why?

The recommended `ExpressionTemplate` is not as performant as a `Utf8JsonWriter`.
`Serilog.Extensions.Formatting.Benchmark.JsonFormatterEnrichBenchmark`

| Method | Formatter | Mean | Error | StdDev | Median | Gen0 | Allocated |
|-----------------------|----------------|-------------:|-------------:|-------------:|-------------:|-----------:|-------------:|
| **EmitLogEvent** | **Json** | **11.81 μs** | **0.230 μs** | **0.236 μs** | **11.89 μs** | **2.8687** | **8.81 KB** |
| **EmitLogEvent** | **Utf8Json** | **12.82 μs** | **0.256 μs** | **0.647 μs** | **12.49 μs** | **2.5024** | **7.76 KB** |
| **EmitLogEvent** | **Expression** | **23.40 μs** | **0.455 μs** | **0.773 μs** | **23.11 μs** | **4.3945** | **13.69 KB** |
| | | | | | | | |
| **ComplexProperties** | **Json** | **18.63 μs** | **0.373 μs** | **0.591 μs** | **18.73 μs** | **3.5400** | **10.91 KB** |
| **ComplexProperties** | **Utf8Json** | **18.48 μs** | **0.362 μs** | **0.519 μs** | **18.37 μs** | **3.1738** | **9.92 KB** |
| **ComplexProperties** | **Expression** | **33.72 μs** | **0.613 μs** | **0.776 μs** | **33.68 μs** | **5.8594** | **18.05 KB** |
| | | | | | | | |
| **IntProperties** | **Json** | **11.45 μs** | **0.209 μs** | **0.186 μs** | **11.44 μs** | **2.7466** | **8.58 KB** |
| **IntProperties** | **Utf8Json** | **13.12 μs** | **0.254 μs** | **0.356 μs** | **12.97 μs** | **2.4414** | **7.53 KB** |
| **IntProperties** | **Expression** | **23.84 μs** | **0.464 μs** | **0.534 μs** | **23.69 μs** | **4.3945** | **13.82 KB** |

Also, I specifically had a use-case in a project which required logs to be in `camelCase`, and none of the built-in formatters supported that, not even `ExpressionTemplate`, since I couldn't find a way to specify a custom `JsonNamingPolicy` for properties.
I specifically had a use-case in a project which required logs to be in `camelCase`, and none of the built-in formatters supported that, not even `ExpressionTemplate`, since I couldn't find a way to specify a custom `JsonNamingPolicy` for properties.

0 comments on commit 1701d14

Please sign in to comment.