<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/library/cpp/yt/misc, 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-19T17:53:29Z</updated>
<entry>
<title>YT-28504: Support heterogeneous lookup in caches</title>
<updated>2026-06-19T17:53:29Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-06-19T17:35:37Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=77f13a22a1d248303c4d9a6ad19c6adbae202dbb'/>
<id>urn:sha1:77f13a22a1d248303c4d9a6ad19c6adbae202dbb</id>
<content type='text'>
commit_hash:acb3e84437f5bdb125d7c1807847eb5edecbb11f
</content>
</entry>
<entry>
<title>Fold TEnumTraits GetMinValue/GetMaxValue to compile time</title>
<updated>2026-06-14T16:10:22Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-06-14T15:50:09Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=969f69bfb876d8108e12cd731d24d3b6f984916b'/>
<id>urn:sha1:969f69bfb876d8108e12cd731d24d3b6f984916b</id>
<content type='text'>
GetMinValue()/GetMaxValue() are constexpr, but when called from a runtime
context for a large-domain enum, clang does not fold the min/max_element and
emits a runtime scan over the whole domain on every call. This is hot on the
master replay path: TEnumIndexedArray::operator[] bounds-checks against these
(e.g. TCypressManager::FindHandler), and TCompositeAutomaton::RememberReign
hits GetCurrentReign() = GetMaxValue() over the ~3300-entry EMasterReign domain
per mutation.

Bind the result to a constexpr local to force compile-time evaluation. Verified
by disasm on a 240-value sample enum: getmin() goes from a ~44-instruction
runtime scan to a single 'mov $const'. No behavior change.

Part of YT-28453 (master replay-speed optimizations).
commit_hash:7cdb969e00ba219415d80c5c8c984aa8bbde99d2
</content>
</entry>
<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>Cache process/thread id getters and use them in TError origin capture</title>
<updated>2026-06-06T21:16:49Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-06-06T20:52:00Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=f10c7206fb31af8057446bceef9707aabaa9456e'/>
<id>urn:sha1:f10c7206fb31af8057446bceef9707aabaa9456e</id>
<content type='text'>
## Motivation
Profiling the YT master Automaton thread showed TOriginAttributes::Capture (run on every non-OK TError) spending ~60% of its time in a getpid() syscall — uncached on glibc &gt;= 2.25. NYT::GetCurrentThreadId() (gettid) feeds hot thread-affinity / log-manager checks on the same thread.

## Changes
- New library/cpp/yt/system/process_id.* with cached GetProcessId(); GetSystemThreadId() now caches the kernel tid in TLS. Both caches reset in the child after fork.
- Moved thread_name.{h,cpp} from misc to system.
- Removed GetCurrentProcessId/GetCurrentThreadId shims from yt/yt/core/misc/proc.{h,cpp}; migrated all callers to NYT::GetProcessId / NYT::GetSystemThreadId.
- TOriginAttributes::Capture uses the cached getters; recorded Tid is now the real kernel tid (matches perf/ps).
- Added microbenchmarks (library/cpp/yt/system/benchmarks, yt/yt/core/benchmarks/error.cpp).

## Microbenchmarks (release)
| | before | after |
|---|---|---|
| getpid | 101 ns | 0.33 ns |
| gettid | 102 ns | 1.64 ns |
| Capture | 161 ns | 50 ns |
| failed TError | 221 ns | 74 ns |
commit_hash:ee37ae57d61a5a2dd33daee935270f4bb93b7ff9
</content>
</entry>
<entry>
<title>Add Abseil-compatible support hashers</title>
<updated>2026-04-27T12:16:34Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-04-27T11:10:55Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=ac1b929087542a400ab0f55f7263c95544baa0b8'/>
<id>urn:sha1:ac1b929087542a400ab0f55f7263c95544baa0b8</id>
<content type='text'>
commit_hash:2d2808f61599fcfea314ad660585e984d50ffbb3
</content>
</entry>
<entry>
<title>YT-27872: Refactor BIND to fix ODR violations</title>
<updated>2026-04-03T12:52:56Z</updated>
<author>
<name>dann239</name>
<email>dann239@yandex-team.com</email>
</author>
<published>2026-04-03T12:15:57Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=57a36bc0bb183d5118c335e84ac02a4f61e257ef'/>
<id>urn:sha1:57a36bc0bb183d5118c335e84ac02a4f61e257ef</id>
<content type='text'>
commit_hash:25c6545fed2bffe20f7a008a218b9245896926ec
</content>
</entry>
<entry>
<title>YT-18571: Drop YT_ATTRIBUTE_NO_UNIQUE_ADDRESS in favor of Y_NO_UNIQUE_ADDRESS</title>
<updated>2026-03-23T11:26:18Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-03-23T10:39:31Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=db3520530fe5ae9f72f156178374fb6d29b5022f'/>
<id>urn:sha1:db3520530fe5ae9f72f156178374fb6d29b5022f</id>
<content type='text'>
commit_hash:c574736c9cbb7c6da6502dc751214d8d7f343568
</content>
</entry>
<entry>
<title>YT-18571: Drop YT_ATTRIBUTE_NO_SANITIZE_ADDRESS in favor of Y_NO_SANITIZE("address")</title>
<updated>2026-03-23T10:59:36Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-03-23T10:35:56Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=a02cf9a7f69ae1aefc38e1dde65565fab69e733c'/>
<id>urn:sha1:a02cf9a7f69ae1aefc38e1dde65565fab69e733c</id>
<content type='text'>
commit_hash:30841b1871a64fd6b3cc1eebcc9e4d5f1281c4fa
</content>
</entry>
<entry>
<title>[yt/misc] remove 64-bit requirement error directive</title>
<updated>2026-03-11T12:52:40Z</updated>
<author>
<name>vasko</name>
<email>vasko@yandex-team.com</email>
</author>
<published>2026-03-11T11:41:39Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=348ba08d3977cb999eba5ae2df579c24454525f7'/>
<id>urn:sha1:348ba08d3977cb999eba5ae2df579c24454525f7</id>
<content type='text'>
commit_hash:5bb34cf1e8e039b59fff79917c694509fff4666c
</content>
</entry>
<entry>
<title>[yt] make SplitMix &amp; HashCombine bit-independent</title>
<updated>2026-03-05T10:11:05Z</updated>
<author>
<name>vasko</name>
<email>vasko@yandex-team.com</email>
</author>
<published>2026-03-05T08:17:14Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=d0739058c7dbc0e2e2b8aa6c5bc399522d5e6fca'/>
<id>urn:sha1:d0739058c7dbc0e2e2b8aa6c5bc399522d5e6fca</id>
<content type='text'>
add realization of hash-functions for 32-bit platforms
commit_hash:3247a0524d3b66d759bf5ebd598be84c8dfb5837
</content>
</entry>
</feed>
