Benchmark the custom ITextFormatter path - #350
Conversation
SinkBenchmarks never passes textFormatter, so every benchmarked configuration takes the built-in LokiJsonTextFormatter fast path. FormatterBenchmarks measures the public Format surface, which the sink does not use in production. The custom-formatter route through the serializer -- Utf8TextWriter over the pooled body buffer -- is therefore not benchmarked at all, and an allocation regression on it is invisible to the CI signal. Add a CustomFormatterSinkBenchmarks group driving the same end-to-end pipeline through MessageTemplateTextFormatter with Serilog's stock output template (the shape reported in #347). Added as a separate group rather than a Formatter param on SinkBenchmarks so the existing rows keep their names and pair with published baselines unchanged. Setup shared by both groups is extracted into SinkSetup, in both the Current and NuGet projects -- Benchmarks.fs is per-project, and the names and params have to match for compare-results.fsx to pair the rows. Refs #349 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 31 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Benchmark comparisonBaseline:
|
First half of #349.
SinkBenchmarksnever passestextFormatter— both its real-target and fake-transport branches use the default — so every benchmarked configuration takes the built-inLokiJsonTextFormatterfast path.FormatterBenchmarksmeasures the publicFormatsurface, which the sink does not use in production (its own comment says so).So the custom-
ITextFormatterroute through the serializer (Utf8TextWriterover the pooled body buffer, rather thanFormatToBuffer) has no benchmark coverage at all, and an allocation regression on it is invisible to theAllocatedsignal CI relies on. That blind spot is how #347 shipped.Change
Adds a
CustomFormatterSinkBenchmarksgroup driving the same end-to-end pipeline throughMessageTemplateTextFormatterwith Serilog's stock output template — the most common custom formatter, and the shape reported in #347.Added as a separate group rather than a
Formatterparam onSinkBenchmarksdeliberately: a new param would rename all four existing rows (they would gainFormatter: "Default"), breaking pairing with published baselines and with the numbers in earlier PR comments. A separate class leaves them byte-identical and adds two rows instead of four.Setup common to both groups is extracted into a private
SinkSetupmodule. Applied to both theCurrentandNuGetprojects —Benchmarks.fsis per-project (onlyEventGen/BenchConfig/Programare shared), and the method names and params must match forcompare-results.fsx, which joins rows byFullName.Measured locally
Baseline and source both allocate a
Utf8TextWriterper event at this point, so this PR should show ~0 delta between them. It establishes the number that the second half of #349 then improves.🤖 Generated with Claude Code