| 31 | } |
| 32 | |
| 33 | static __attribute__((noinline)) benchmark::BenchmarkReporter::Run |
| 34 | bench_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 | |
| 60 | void benchmark_all(benchmark::Benchmark& benchmark) { |
| 61 | double* dbl_arr; |
no test coverage detected