summaryrefslogtreecommitdiff
path: root/benchmarks/db_bench.cc
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/db_bench.cc')
-rw-r--r--benchmarks/db_bench.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/benchmarks/db_bench.cc b/benchmarks/db_bench.cc
index db866f5..8e3f4e7 100644
--- a/benchmarks/db_bench.cc
+++ b/benchmarks/db_bench.cc
@@ -126,6 +126,9 @@ static bool FLAGS_compression = true;
// Use the db with the following name.
static const char* FLAGS_db = nullptr;
+// ZSTD compression level to try out
+static int FLAGS_zstd_compression_level = 1;
+
namespace leveldb {
namespace {
@@ -779,11 +782,21 @@ class Benchmark {
}
void ZstdCompress(ThreadState* thread) {
- Compress(thread, "zstd", &port::Zstd_Compress);
+ Compress(thread, "zstd",
+ [](const char* input, size_t length, std::string* output) {
+ return port::Zstd_Compress(FLAGS_zstd_compression_level, input,
+ length, output);
+ });
}
void ZstdUncompress(ThreadState* thread) {
- Uncompress(thread, "zstd", &port::Zstd_Compress, &port::Zstd_Uncompress);
+ Uncompress(
+ thread, "zstd",
+ [](const char* input, size_t length, std::string* output) {
+ return port::Zstd_Compress(FLAGS_zstd_compression_level, input,
+ length, output);
+ },
+ &port::Zstd_Uncompress);
}
void Open() {