Export of internal Abseil changes.
-- 9fa04b5fb4b6aeb47226b9095b3bc36a53669c39 by Abseil Team <absl-team@google.com>: Release types/compare.h, which contains stand ins for three-way comparison result types from C++20. Use absl::weak_ordering for a three-way comparator in test-instance-tracker.h. PiperOrigin-RevId: 247290078 -- 70a762f4eb35ea1d5a5fcb3274a8086824a0b82c by Derek Mauro <dmauro@google.com>: Upgrade linux_clang-latest builds to LLVM r356814 and Bazel 0.25.0 PiperOrigin-RevId: 247250176 -- f305cd5c36561e4dbb69eb87568553ae5badcb15 by CJ Johnson <johnsoncj@google.com>: Remove argument deduction based on template template argument in InlinedVector/Storage PiperOrigin-RevId: 247232334 -- 2cab8e426838baceb7d08edb313416480d26aa5b by Eric Fiselier <ericwf@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 247140132 GitOrigin-RevId: 9fa04b5fb4b6aeb47226b9095b3bc36a53669c39 Change-Id: I373a7d9bc90befa2a9f06555cb8703610c0313b9
This commit is contained in:
parent
aa468ad755
commit
27c2f6e2f3
18 changed files with 982 additions and 14 deletions
|
|
@ -47,6 +47,56 @@ void BM_Step_Days(benchmark::State& state) {
|
|||
}
|
||||
BENCHMARK(BM_Step_Days);
|
||||
|
||||
void BM_GetWeekday(benchmark::State& state) {
|
||||
const cctz::civil_day c(2014, 8, 22);
|
||||
while (state.KeepRunning()) {
|
||||
benchmark::DoNotOptimize(cctz::get_weekday(c));
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_GetWeekday);
|
||||
|
||||
void BM_NextWeekday(benchmark::State& state) {
|
||||
const cctz::civil_day kStart(2014, 8, 22);
|
||||
const cctz::civil_day kDays[7] = {
|
||||
kStart + 0, kStart + 1, kStart + 2, kStart + 3,
|
||||
kStart + 4, kStart + 5, kStart + 6,
|
||||
};
|
||||
const cctz::weekday kWeekdays[7] = {
|
||||
cctz::weekday::monday, cctz::weekday::tuesday, cctz::weekday::wednesday,
|
||||
cctz::weekday::thursday, cctz::weekday::friday, cctz::weekday::saturday,
|
||||
cctz::weekday::sunday,
|
||||
};
|
||||
while (state.KeepRunningBatch(7 * 7)) {
|
||||
for (const auto from : kDays) {
|
||||
for (const auto to : kWeekdays) {
|
||||
benchmark::DoNotOptimize(cctz::next_weekday(from, to));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_NextWeekday);
|
||||
|
||||
void BM_PrevWeekday(benchmark::State& state) {
|
||||
const cctz::civil_day kStart(2014, 8, 22);
|
||||
const cctz::civil_day kDays[7] = {
|
||||
kStart + 0, kStart + 1, kStart + 2, kStart + 3,
|
||||
kStart + 4, kStart + 5, kStart + 6,
|
||||
};
|
||||
const cctz::weekday kWeekdays[7] = {
|
||||
cctz::weekday::monday, cctz::weekday::tuesday, cctz::weekday::wednesday,
|
||||
cctz::weekday::thursday, cctz::weekday::friday, cctz::weekday::saturday,
|
||||
cctz::weekday::sunday,
|
||||
};
|
||||
while (state.KeepRunningBatch(7 * 7)) {
|
||||
for (const auto from : kDays) {
|
||||
for (const auto to : kWeekdays) {
|
||||
benchmark::DoNotOptimize(cctz::prev_weekday(from, to));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_PrevWeekday);
|
||||
|
||||
const char RFC3339_full[] = "%Y-%m-%dT%H:%M:%E*S%Ez";
|
||||
const char RFC3339_sec[] = "%Y-%m-%dT%H:%M:%S%Ez";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue