MCPcopy Create free account
hub / github.com/cwida/ALP / bench_encode_zstd

Function bench_encode_zstd

publication/source_code/bench_speed/bench_zstd.cpp:33–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static __attribute__((noinline)) benchmark::BenchmarkReporter::Run
34bench_encode_zstd(alp_bench::ALPColumnDescriptor& dataset, double* dbl_arr, void* enc_arr) {
35
36 int benchmark_number = dataset.id;
37
38#ifdef NDEBUG
39 uint64_t iterations = 300000 / 128;
40#else
41 uint64_t iterations = 1;
42#endif
43
44 std::string benchmark_name = dataset.name + "_encode";
45
46 size_t ENC_SIZE_UPPER_BOUND = 8 * 131072;
47 size_t INPUT_SIZE = ENC_SIZE_UPPER_BOUND;
48
49 uint64_t cycles = benchmark::cycleclock::Now();
50 for (uint64_t j = 0; j < iterations; ++j) {
51 ZSTD_compress(enc_arr, ENC_SIZE_UPPER_BOUND, dbl_arr, INPUT_SIZE, 3);
52 }
53
54 cycles = benchmark::cycleclock::Now() - cycles;
55
56 return benchmark::BenchmarkReporter::Run(
57 benchmark_number, benchmark_name, iterations, double(cycles) / (double(iterations) * 131072));
58}
59
60void benchmark_all(benchmark::Benchmark& benchmark) {
61 double* dbl_arr;

Callers 1

benchmark_allFunction · 0.85

Calls 2

NowFunction · 0.50
RunClass · 0.50

Tested by

no test coverage detected