summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* Upver wine 10.8nechda2025-06-191-0/+4
| | | | commit_hash:db0a0308d356c8dca2520f3881de2615edcc4455
* Check that bytes consist of 8 bitsakhropov2025-06-171-0/+4
| | | | commit_hash:9eaf085276f1f93768b8b0e5ec92a53bf0db86a8
* Add TMultiHashMap::node_allocator_typesergey-tiunov2025-06-111-0/+1
| | | | | Добавляем `TMultiHashMap::node_allocator_type` по аналогии с [THashMap::node_allocator_type](https://a.yandex-team.ru/arcadia/util/generic/hash.h?rev=rXXXXXX#L19), чтобы вычислять объем занимаемой памяти объектов `TMultiHashMap`. commit_hash:49c8bbcd57ac8292ff1fffa7b59e45fdd88c3278
* [util] the THashSet::operator== must compare elements using their comparison ↵swarmer2025-06-083-9/+111
| | | | | | | | | | | | | operators. The C++ standard describes the requirements for comparing unordered containers in [unord.req.general]: > Two unordered containers a and b compare equal if a.size() == b.size() and, > for every equivalent-key group [Ea1, Ea2) obtained from a.equal_range(Ea1), > there exists an equivalent-key group [Eb1, Eb2) obtained from b.equal_range(Ea1), > such that is_permutation(Ea1, Ea2, Eb1, Eb2) returns true. THashSet should use the same comparison logic. commit_hash:b897cd7387d275324bb22268d0be79da4e74bf16
* [util] Obtain uptime from the clock_gettime syscallswarmer2025-05-311-7/+4
| | | | | Reading /proc/uptime is about a hundred times slower than accessing the same timer via the clock_gettime call. The latter also has better precision. commit_hash:70904860adc43c9d2d6487a415a2e6b27fe6dae7
* adding the required includes, which were previously only available ↵swarmer2025-05-304-0/+6
| | | | | | transitively via the JOIN_SRCS macro commit_hash:9769490daa4d0e88eaf1b4147ccc961be6031d04
* better fork-aware poola11ax2025-05-221-7/+14
| | | | | | | | | Было: при добавлении-удалении обьекта берем мьютекс, молимся чтобы тот не оказался залочен при форке, никак перед форком на лок не смотрим Помимо того что это просто не очень надежно, оно не всегда работает. Может случиться так что с мьютексом все нормально, но IntrusiveList все равно [скорапчен](HIDDEN_URL и список закольцован не там где надо (по всей видимости cpu reorder на apple m1 ехидничает). Стало: берем спинлок вместо мьютекса, в том числе берем его на время форка. commit_hash:94145ab392390a2c0b9f885275302082524606b2
* remove unused includestobo2025-05-212-7/+2
| | | | commit_hash:1853234e3cc2386843bcb3c973f43778e813efeb
* Add utf8 shrink functionsnemal3002025-05-213-0/+101
| | | | commit_hash:eebf8de05f89401d692625c13336aad120b149fc
* Update Cython to 3.0.10.nik-bes2025-05-191-10/+10
| | | | commit_hash:b43c96b868cd36d636192fd2c6024d9f0d2fb6f8
* Fix and improve documentation commentsakhropov2025-05-181-26/+26
| | | | commit_hash:f542118888ac27e5c731c6da1de70b30e2a082e9
* Remove SSE*_ENABLED defines and use predefined compiler macros insteadthegeorg2025-05-171-12/+12
| | | | commit_hash:38a7fed85214a0b939bdd770ba2244ff0f195f63
* util: Reduce the number of string allocation within the TypeName<T> functionswarmer2025-04-261-8/+12
| | | | | Don't copy a `const char *` into a temporary `TString`, only to convert it back to a `const char *`. commit_hash:f291a94106900ceae8ae830f20716cb35f8aab2d
* GetRef in TPointerCommonilnurkh2025-04-253-0/+50
| | | | commit_hash:4149625a81c51af40642fe498a887608cc57305f
* Intermediate changesrobot-piglet2025-04-241-1/+3
| | | | commit_hash:ae46d476745bcde01f2465ccfec1ae45e8d29d1e
* Intermediate changesrobot-piglet2025-04-112-2/+12
| | | | commit_hash:2b7b64700156a1d0ddea136ff1c94469867108fe
* Fix circular #include between util/system/file.h and util/system/flock.hthegeorg2025-04-011-1/+0
| | | | commit_hash:8174b7a8774277eccfa7768caeabde7f2c52b5bc
* Fix grammarakhropov2025-03-281-2/+2
| | | | commit_hash:acff119fbd5252738b5c3a948a428b3cb2a36801
* Fix circular #include between util/stream/output.h and util/stream/debug.hthegeorg2025-03-286-116/+88
| | | | commit_hash:4c198f344c22ca2387327f8ed6f9bed70d33f7e1
* Merge yexception.h and bt_exception.h to prevent include cyclethegeorg2025-03-286-33/+20
| | | | commit_hash:4a6a74639669cf2836dedbc7b61efb1f43faef1f
* Add an option to disable the fork aware mode for TThreadPoolandybg2025-03-282-2/+14
| | | | | | | | | | | | | Продолжение починки крэшей при форке Ситуация такая же - используем subprocess для обработки данных ( subprocess не наши, написаны множеством команд на нескольких языках под конкретные ситуации), быстро избавиться от форка не получится. Есть шанс избавиться от этого пул треда, но тоже не быстро. Предлагается простое решение - не вызывать `TAtforkQueueRestarter::Get()`совсем, тогда не будет создание singletonа и вызова `pthread_atfork`. Все это под опцией `SetForkAware` - кто хочет может ее включать, для всех остальных ничего не изменится. Полная обратная совместимость, фикс ничего не мог зацепить. Проверил локально, вызова `pthread_atfork` нет в `unified agent` больше. Тесты на это очень сложно написать, без больших изменений в тред пуле, пробовал с перехватом `pthread_atfork`, к сожалении, не только `TAtforkQueueRestarter` им пользуется и нормально перехватить тоже не получилось. commit_hash:3711c6175ca64564f31f811ee1308d70ef6eb5e3
* Move TCowString to librarymikhnenko2025-03-272-8/+3
| | | | commit_hash:a86d9f2d841389cbec73f6976d4a0f78fc152116
* Added SafeCastToEnumkshalnev2025-03-276-0/+139
| | | | commit_hash:44102d9b2c000eefdfd91997a40a055b29d647c7
* [util] SafeIntegerCast: make fast path slightly faster & reduce code sizeswarmer2025-03-261-10/+13
| | | | commit_hash:8adef8417b7bb90754f71cf0a5be075dee84a718
* Use ::npos from corret typemikhnenko2025-03-241-6/+6
| | | | commit_hash:08f65c81be02eb75781b150a4e6f683dc9be31a3
* spinlock: move unlock operations into the TSpinLockBase classswarmer2025-03-201-16/+8
| | | | commit_hash:97d3f3aa633aa9376f38930ef3b6bdb5e784bb97
* Fix Y_LIFETIMEBOUND placement in TArrayRef ctorvadim-xd2025-03-201-1/+1
| | | | | | | | | | | | | | | Detected by clang 20 ```cpp struct TFoo { const int X[10]; }; void Foo() { TArrayRef<const int> a{TFoo{}.X}; // error } ``` commit_hash:299f849c2d3cc640866eee3ff82be37f624ac70d
* Add Y_NONNULL attribute macronechda2025-03-181-0/+19
| | | | commit_hash:140767fba3ddf262d702b06bc0bade2616e5a317
* remove Y_STRING_LIFETIME_BOUNDtazjin2025-03-121-18/+0
| | | | | | | This macro was previously used to conditionally toggle `lifetimebound` for `TString`-related functions which took its copy-on-write behaviour into account. As of rXXXXXX this is no longer used. commit_hash:93ac110d46ffbe59751c2cecc685b9838bba42b4
* check lifetimes of TStringBuf constructed from TString without taking into ↵swarmer2025-03-111-1/+1
| | | | | | | | | | | | | account copy-on-write semantics `TString` is a copy-on-write type, which means that in some cases the valid lifetime of its data might extend beyond the lifetime of an individual `TString` (if it was copied). However, there are practically no cases where this behaviour is appropriate, and leaving around an "owning" `TString` is undesirable. Due to this behaviour we have previously refrained from enabling `[[clang::lifetimebound]]` for `TStringBuf` constructors, because some cases of view construction from a temporary `TString` were in fact valid. This commit enables the check, as all existing related bugs in Arcadia have been fixed. Please see the related ticket and the announcement on Этушка (link will be in the post-commit comments) for more information. commit_hash:b2b6831ac3106a4e76064b85ec2d748b415ed67c
* [util] track the lifetime of strings passed through the StripString function ↵swarmer2025-03-082-0/+82
| | | | | | | | | | | | | family Specialize StripString functions for the std::string_view and TStringBuf types. An example of erroneous code in which the compiler will be able to detect a problem with the lifetime of temporary string: ``` TStringBuf sb = StripString(TStringBuf{" abc "s}); Use(sb); // segfault ``` commit_hash:ad47648de30fd1a7e59d39a8ec3918fd1484a0ba
* allow disable arcadia backtracev-belikov2025-03-062-1/+18
| | | | | | Проблема: исключения отнаследованные от `TWithBackTrace` едят много CPU, что уже приводило к инцидентам. Кроме того, они не работают в фреймворке uservices. Решение: разрешить отключать сбор бэктрейсов в рантайме commit_hash:ad101368d384c90b5b37ac66276ae6611731d579
* feat envoy: Fix linking errors in util when building for WASM platform.vchigrin2025-03-013-4/+4
| | | | | | | Fix linking errors due to missed _Unwind_Backtrace symbol. Fix linking error due to missed CurrentThreadId implementation. commit_hash:ba09595a0e5feaefe5ad506c0005815f4c11a153
* [util] getting rid of LUT in DayOfYearToMonthtobo2025-02-271-28/+5
| | | | commit_hash:9ec33d0cbe2da6aeea6e8d02fdaed5f45b6e3534
* Intermediate changesrobot-piglet2025-02-241-48/+69
| | | | commit_hash:ec09e953e6ed7b89ab18dfdac86961de36b5b2ea
* [util] speedup GmTimeR outside LUT intervaltobo2025-02-183-81/+133
| | | | commit_hash:d57be220df393c193619ef5ed129ec4436540629
* Intermediate changesrobot-piglet2025-02-111-1/+3
| | | | commit_hash:f3acde65f4eb25503f414d5262f52b496123bd96
* [util] GmTimeR: use LUT for the tm_yday -> tm_mday conversionswarmer2025-02-111-70/+31
| | | | | Replacing binary search with a look-up table. The performance of which does not depend on the branch predictor, and conversion works equally fast for any dates. commit_hash:fefe9665d0d4b51c2ae09ec2b2816aed30caa57b
* [util] GmTimeR: speedup a bittobo2025-02-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | perf before ``` ------------------------------------------------------------------------------- Benchmark Time CPU Iterations ------------------------------------------------------------------------------- BM_GmTimeR 3.61 ns 3.61 ns 194952699 BM_GmTimeRRandom/last_hour 5.04 ns 5.04 ns 136121940 BM_GmTimeRRandom/last_day 5.03 ns 5.03 ns 139883239 BM_GmTimeRRandom/last_month 8.03 ns 8.03 ns 87839823 BM_GmTimeRRandom/last_year 14.9 ns 14.9 ns 46401773 BM_GmTimeRRandom/last_decade 16.9 ns 16.9 ns 41439312 BM_GmTimeRRandom/last_half_centry 16.9 ns 16.9 ns 41225553 ``` perf after ``` ------------------------------------------------------------------------------- Benchmark Time CPU Iterations ------------------------------------------------------------------------------- BM_GmTimeR 3.27 ns 3.27 ns 215390890 BM_GmTimeRRandom/last_hour 4.52 ns 4.52 ns 154869504 BM_GmTimeRRandom/last_day 4.53 ns 4.53 ns 155409964 BM_GmTimeRRandom/last_month 7.24 ns 7.24 ns 96972146 BM_GmTimeRRandom/last_year 13.5 ns 13.5 ns 51957829 BM_GmTimeRRandom/last_decade 15.5 ns 15.5 ns 45192135 BM_GmTimeRRandom/last_half_centry 15.4 ns 15.4 ns 45526906 ``` commit_hash:ac9db56d93a25c3a3018cfbb6bc5800da3d001ee
* GmTimeR x2 speeduptobo2025-02-081-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | performance comparison againt standard gmtime\_r ``` ------------------------------------------------------------------------------- Benchmark Time CPU Iterations ------------------------------------------------------------------------------- BM_GmTimeR 3.66 ns 3.66 ns 189855900 BM_gmtime_r 18.7 ns 18.7 ns 37340999 BM_GmTimeRRandom/last_hour 5.12 ns 5.12 ns 136126173 BM_gmtime_r_Random/last_hour 19.2 ns 19.2 ns 36556971 BM_GmTimeRRandom/last_day 5.10 ns 5.10 ns 138257644 BM_gmtime_r_Random/last_day 19.2 ns 19.2 ns 37025160 BM_GmTimeRRandom/last_month 7.10 ns 7.10 ns 98235494 BM_gmtime_r_Random/last_month 20.4 ns 20.4 ns 34637975 BM_GmTimeRRandom/last_year 15.0 ns 15.0 ns 46664304 BM_gmtime_r_Random/last_year 26.8 ns 26.8 ns 26135911 BM_GmTimeRRandom/last_decade 17.2 ns 17.2 ns 40105536 BM_gmtime_r_Random/last_decade 27.0 ns 27.0 ns 25817056 BM_GmTimeRRandom/last_half_centry 17.1 ns 17.0 ns 41066079 BM_gmtime_r_Random/last_half_century 26.8 ns 26.7 ns 26215076 ``` commit_hash:33747760ad46412f50fe3cb06f4c438794a44492
* Intermediate changesrobot-piglet2025-02-071-1/+20
| | | | commit_hash:21bc37ea2a290cb645c95fe2c94882484c7001a4
* Introduce TMemoryPool::TBookmarkppavel962025-02-042-0/+61
| | | | | | Данный PR добавляет класс TMemoryPool::TBookmark, запомниющий текущее состояние пула при создании и восстанавливающий это состояние в деструкторе. В случае, если в пуле успел смениться текущий чанк, то очищается только последний чанк. commit_hash:cfeb77912864d25d5d8c34739915c504e289770a
* Fix -Wnon-virtual-dtor in util and gtest wrapperthegeorg2025-01-231-0/+1
| | | | commit_hash:d8917bc04e6ab10b341000f8bb98d456223f0307
* clang-format 18 in STYLE_CPPalevitskii2025-01-209-62/+65
| | | | | clang-format 18 in STYLE\_CPP commit_hash:e2018ac17a95817f09e131ee6d5316b2bdc2d39e
* Fix util build for WASM32 platform.vchigrin2025-01-171-1/+5
| | | | commit_hash:14cab8a6f31c744cf717b9b093109987ceae7654
* Intermediate changesrobot-piglet2025-01-131-0/+2
| | | | commit_hash:afb0e5dfd167841b49b56adc86c88a1e9f5492c6
* Intermediate changesrobot-piglet2025-01-031-2/+2
| | | | commit_hash:150f0a7b765d0ba270d9e42834bcf4c074ca0524
* Do not yield GLOBAL define regarding current C++ runtimethegeorg2025-01-031-1/+2
| | | | | | This codesearch query yields all the results (i. e. only `yexception_ut.cpp` depends on this define): HIDDEN_URL commit_hash:9cac855ba71451e3691fc514a5a423173c3a8aae
* Remove non-existing functions.akhropov2024-12-244-21/+2
| | | | commit_hash:ff6e98554280ce1c021da5272fde9421374a643d
* Add using for TCowStringmikhnenko2024-12-221-0/+3
| | | | commit_hash:4173484eaeb8e4dd6ea84e26ae7f496e35785564