diff options
author | tobo <tobo@yandex-team.com> | 2022-08-25 07:36:11 +0300 |
---|---|---|
committer | tobo <tobo@yandex-team.com> | 2022-08-25 07:36:11 +0300 |
commit | 62b3eaa578ea03c63d0fd1ee409e13e360b1ab93 (patch) | |
tree | c21c3b755623ef7e111d7786adb69103554318c3 /library/cpp/cppparser | |
parent | 25270694776a35000bcb18c5302b1ad1ba9b87a8 (diff) | |
download | ydb-62b3eaa578ea03c63d0fd1ee409e13e360b1ab93.tar.gz |
speedup GmTimeR function
в профиле перфа Маркетного репорта постоянно вижу GmTimeR
там в цикле вычитается по количеству дней в году и прибавляется по 1 году с 1970 по 2022 на каждый вызов
В Маркете проблема стреляла и раньше
в последней итерации функция становится на ~~30% быстрее системной gmtime_r
%%
----------- GmTimeR ---------------
samples: 20691
iterations: 264304536
iterations hr: 264M
run time: 5.002055225
per iteration: 39.85866484 cycles
----------- gmtime_r ---------------
samples: 17452
iterations: 188034528
iterations hr: 188M
run time: 5.001259884
per iteration: 56.96146577 cycles
%%
текущая верся почти в 2 раза медленнее системной:
%%
----------- GmTimeR ---------------
samples: 12760
iterations: 100514931
iterations hr: 101M
run time: 5.00096133
per iteration: 105.4334174 cycles
----------- gmtime_r ---------------
samples: 17667
iterations: 192697896
iterations hr: 193M
run time: 5.001356603
per iteration: 55.69031415 cycles
%%
Diffstat (limited to 'library/cpp/cppparser')
0 files changed, 0 insertions, 0 deletions