<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/library/cpp/yt/misc/guid.cpp, branch CLI_2.32.0</title>
<subtitle>Mirror of YDB github repos</subtitle>
<id>https://code.mastervirt.ru/ydb/atom?h=CLI_2.32.0</id>
<link rel='self' href='https://code.mastervirt.ru/ydb/atom?h=CLI_2.32.0'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/'/>
<updated>2026-06-12T21:17:12Z</updated>
<entry>
<title>Speed up NYT::Format</title>
<updated>2026-06-12T21:17:12Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-06-12T20:53:40Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=42e4b751702f065de932ef765bc6948c5e7d1e4b'/>
<id>urn:sha1:42e4b751702f065de932ef765bc6948c5e7d1e4b</id>
<content type='text'>
Profile-driven optimizations of the `Format` hot path, benchmarked against a representative master debug log (structured `"Key: %v"` messages dominated by GUIDs, strings, integers, bools and durations). Median improvements of ~15-20% across the workload, measured on a dedicated host.

Changes:
- `string_builder`: use `resize_uninitialized` in `DoReserve` to avoid zero-filling the buffer on every `Format` call.
- `format`: replace the per-argument `memchr` (`spec.Contains('n')`) with an inline scan, force-inline `RunFormatterAt`, and add a `FormatString` fast path for the common plain `%v` / empty spec.
- `guid`: rewrite `WriteGuidToBuffer` using a `clz`-derived digit count and a back-to-front fill instead of the per-magnitude branch cascade (cut from ~26% to ~12% of a GUID-heavy line). Validated against an `%x` reference over 2M random GUIDs plus edge cases.

Also adds `library/cpp/yt/string/benchmark` to track `Format` performance.

### Benchmarks

Median ns/op (lower is better), pinned core on a dedicated Xeon E5-2650 v2, 9x1s repetitions. See `library/cpp/yt/string/benchmark`.

| Benchmark | What it formats | Before | After | Speedup |
| --- | --- | ---: | ---: | ---: |
| `ManyMixedArgs` | ~18 args: GUIDs, strings, duration, ints | 1030 | 833 | -19% |
| `StringAndTwoGuids` | literal prefix + two GUIDs | 233 | 185 | -21% |
| `IntAndGuid` | one int + one GUID | 205 | 179 | -13% |
| `ManyInts` | six integers | 389 | 340 | -13% |
| `Guid` | a single GUID | 156 | 131 | -16% |
| `String` | a single string | 139 | 104 | -25% |
| `Int` | a single integer | 142 | 120 | -15% |
| `NoArgs` | a literal with no arguments | 88.8 | 85.7 | -3% |
commit_hash:ce9957a06c3ff28b2889aa65fbbddf4ca444f9fe
</content>
</entry>
<entry>
<title>YT-22593: More trivial TString-&gt;std::string migrations</title>
<updated>2025-02-22T14:48:29Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2025-02-22T14:28:25Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=59afaa0cb7cd89146dd10f5446256afcce33bd0e'/>
<id>urn:sha1:59afaa0cb7cd89146dd10f5446256afcce33bd0e</id>
<content type='text'>
[nodiff:runtime]
commit_hash:1ba799aed1703ab7c6304b6da7090b3337f768dd
</content>
</entry>
<entry>
<title>YT-21233: Remove TSimpleException and teach TCompositeException storing simple attributes</title>
<updated>2024-03-28T06:58:54Z</updated>
<author>
<name>arkady-e1ppa</name>
<email>arkady-e1ppa@yandex-team.com</email>
</author>
<published>2024-03-28T06:47:08Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=48212452a70da88a5e4b814979dd82f22379801f'/>
<id>urn:sha1:48212452a70da88a5e4b814979dd82f22379801f</id>
<content type='text'>
Expand the CompositeException
9a10ec65bfc1df854e03bb3a4d8d0a0c0e4a3a5d
</content>
</entry>
<entry>
<title>More TGuid helpers</title>
<updated>2023-11-25T14:31:15Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2023-11-25T14:05:18Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=ef0f7daa4fdd7a8866514cdd37dafdb5ceaa9724'/>
<id>urn:sha1:ef0f7daa4fdd7a8866514cdd37dafdb5ceaa9724</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restoring authorship annotation for &lt;babenko@yandex-team.ru&gt;. Commit 2 of 2.</title>
<updated>2022-02-10T13:49:19Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.ru</email>
</author>
<published>2022-02-10T13:49:19Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=f31097c96270919a1f49360bdaaa69ea4f3fefab'/>
<id>urn:sha1:f31097c96270919a1f49360bdaaa69ea4f3fefab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restoring authorship annotation for &lt;babenko@yandex-team.ru&gt;. Commit 1 of 2.</title>
<updated>2022-02-10T13:49:19Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.ru</email>
</author>
<published>2022-02-10T13:49:19Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=cec37806d8847aa3db53bafc9e251d4aaf325c12'/>
<id>urn:sha1:cec37806d8847aa3db53bafc9e251d4aaf325c12</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restoring authorship annotation for &lt;ignat@yandex-team.ru&gt;. Commit 2 of 2.</title>
<updated>2022-02-10T13:48:20Z</updated>
<author>
<name>ignat</name>
<email>ignat@yandex-team.ru</email>
</author>
<published>2022-02-10T13:48:20Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=12d7840a194f4a6e4ea77a405f980074cf43e942'/>
<id>urn:sha1:12d7840a194f4a6e4ea77a405f980074cf43e942</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restoring authorship annotation for &lt;ignat@yandex-team.ru&gt;. Commit 1 of 2.</title>
<updated>2022-02-10T13:48:20Z</updated>
<author>
<name>ignat</name>
<email>ignat@yandex-team.ru</email>
</author>
<published>2022-02-10T13:48:20Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=c8b279dd21ddcb47e755028d81281f113a0f4a11'/>
<id>urn:sha1:c8b279dd21ddcb47e755028d81281f113a0f4a11</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restoring authorship annotation for &lt;max42@yandex-team.ru&gt;. Commit 2 of 2.</title>
<updated>2022-02-10T13:47:51Z</updated>
<author>
<name>max42</name>
<email>max42@yandex-team.ru</email>
</author>
<published>2022-02-10T13:47:51Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=884333bd8b9068bc6b852b948e9d8f23fd393ab7'/>
<id>urn:sha1:884333bd8b9068bc6b852b948e9d8f23fd393ab7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Restoring authorship annotation for &lt;max42@yandex-team.ru&gt;. Commit 1 of 2.</title>
<updated>2022-02-10T13:47:51Z</updated>
<author>
<name>max42</name>
<email>max42@yandex-team.ru</email>
</author>
<published>2022-02-10T13:47:51Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=9988f7c537b40605e1a0aaae2977d5f540425b83'/>
<id>urn:sha1:9988f7c537b40605e1a0aaae2977d5f540425b83</id>
<content type='text'>
</content>
</entry>
</feed>
