Skip to content

Commit

Permalink
set rocksdb block cache to 4gb
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 authored and cberner committed Aug 4, 2024
1 parent 3ca4467 commit 5b1d50c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion benches/lmdb_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,15 @@ fn main() {

let rocksdb_results = {
let tmpfile: TempDir = tempfile::tempdir_in(&tmpdir).unwrap();
let db = rocksdb::TransactionDB::open_default(tmpfile.path()).unwrap();

let mut bb = rocksdb::BlockBasedOptions::default();
bb.set_block_cache(&rocksdb::Cache::new_lru_cache(4 * 1_024 * 1_024 * 1_024));

let mut opts = rocksdb::Options::default();
opts.set_block_based_table_factory(&bb);
opts.create_if_missing(true);

let db = rocksdb::TransactionDB::open(&opts, &Default::default(), tmpfile.path()).unwrap();
let table = RocksdbBenchDatabase::new(&db);
benchmark(table)
};
Expand Down

0 comments on commit 5b1d50c

Please sign in to comment.