summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/logging/benchmark
Commit message (Collapse)AuthorAgeFilesLines
* YT-28451: Add tagged logging API and opaque event payloadbabenko4 days2-0/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace `TLogEvent::MessageRef` with an opaque `Payload` that carries the message together with structured key/value tags, deferring tag rendering to the consumer (logging thread). - Add the `TTaggedPayloadWriter`/`TTaggedPayloadReader` codec (`NDetail`), with a per-thread chunk-cached builder so tagged logging does no per-message heap allocation. - Model the payload as a typed `TLogEventPayload` — a `std::variant` of the opaque strong typedefs `TTaggedLogEventPayload` and `TStructuredLogEventPayload` (each over `TSharedRef`). The active alternative identifies the event kind, so the separate `ELogMessageKind` enum and `TLogEvent::MessageKind` field are removed; consumers dispatch via `std::holds_alternative`/`std::get` instead of a tag. - Add the fluent `YT_TLOG_*` API: `YT_TLOG_INFO("Message").With(key, value)` and `.With(key, value, "%spec")`; disabled levels skip argument evaluation. - Add well-known tags: `.With(value)` attaches a value under a statically known key resolved by ADL (e.g. `.With(error)` for the `Error` tag). - Teach the plain-text and structured formatters to render tags; add the `enable_native_tags` knob to emit tags into a nested structured attribute. - Add producer-side benchmarks. The tagged API is cheaper than `YT_LOG_*` for tagged calls and on par for tag-free ones: #| || **Producer call** | **`YT_LOG_*`** | **`YT_TLOG_*`** | **Δ** || || no tags | 81 ns | 82 ns | +2% || || 1 tag | 124 ns | 88 ns | -29% || || 2 tags | 140 ns | 101 ns | -28% || || 3 tags | 372 ns | 283 ns | -24% || |# -- #| || **<a href="https://nda.ya.ru/t/p0sVNSOC7ijzFF" target="_blank">![](https://nda.ya.ru/t/mAiQIjHx7Mm3JC =30x) Echo tests</a>** || |# commit_hash:70efc90e5c2b71e5311415a4e4508db42ff28971
* Optimize TLogger::WithTag/WithRawTagpechatnov2026-07-032-0/+46
Make TLogger::WithTag use a compile-time format string commit_hash:0a119b8eb278bceb411b7d071bbefe0b41e6233d