cyb70289 commented on code in PR #14938:
URL: https://github.com/apache/arrow/pull/14938#discussion_r1047920984
##########
cpp/src/arrow/util/benchmark_util.h:
##########
@@ -46,12 +39,22 @@ struct BenchmarkArgsType<benchmark::internal::Benchmark* (
using type = Values;
};
-// Benchmark changed its parameter type between releases from
-// int to int64_t. As it doesn't have version macros, we need
-// to apply C++ template magic.
using ArgsType =
typename
BenchmarkArgsType<decltype(&benchmark::internal::Benchmark::Args)>::type;
+using internal::CpuInfo;
+
+static const CpuInfo* cpu_info = CpuInfo::GetInstance();
+
+static const int64_t kL1Size = cpu_info->CacheSize(CpuInfo::CacheLevel::L1);
+static const int64_t kL2Size = cpu_info->CacheSize(CpuInfo::CacheLevel::L2);
+static const int64_t kL3Size = cpu_info->CacheSize(CpuInfo::CacheLevel::L3);
+static const int64_t kCantFitInL3Size = kL3Size * 4;
+static const std::vector<int64_t> kMemorySizes = {kL1Size, kL2Size, kL3Size,
+ kCantFitInL3Size};
+// 0 is treated as "no nulls"
Review Comment:
The reciprocal representation is a bit confusing to me. Maybe we can used
"per ten thousand" unit. And move 0 to the first element, so null proportion is
increasing.
[0, 1, 100, 1000, 5000, 10000] / 10000.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]