support mace 0.0.24

This commit is contained in:
abbycin 2026-01-19 11:53:17 +08:00
parent da89a88b40
commit 36c15dc0d0
Signed by: abby
GPG Key ID: B636E0F0307EF8EB
14 changed files with 8 additions and 5 deletions

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2024" edition = "2024"
[dependencies] [dependencies]
mace-kv = "0.0.23" mace-kv = "0.0.24"
clap = { version = "4.5.48", features = ["derive"] } clap = { version = "4.5.48", features = ["derive"] }
rand = "0.9.2" rand = "0.9.2"
log = "0.4.22" log = "0.4.22"

View File

@ -1,7 +1,9 @@
# mace 0.0.23 vs rocksdb 10.4.2 # mace 0.0.24 vs rocksdb 10.4.2
**mace 0.0.24 traded a slight dip in query performance for a 10+% boost in insertion performance.**
## sequential insert ## sequential insert
![mace__sequential_insert](./scripts/mace_sequential_insert.png) ![mace_sequential_insert](./scripts/mace_sequential_insert.png)
![rocksdb_sequential_insert](./scripts/rocksdb_sequential_insert.png) ![rocksdb_sequential_insert](./scripts/rocksdb_sequential_insert.png)

View File

@ -115,8 +115,8 @@ int main(int argc, char *argv[]) {
// top.use_delta_encoding = false; // top.use_delta_encoding = false;
// cfo.table_factory.reset(rocksdb::NewBlockBasedTableFactory(top)); // cfo.table_factory.reset(rocksdb::NewBlockBasedTableFactory(top));
// use 1GB block cache // use 3GB block cache
auto cache = rocksdb::NewLRUCache(1 << 30); auto cache = rocksdb::NewLRUCache(3 << 30);
rocksdb::BlockBasedTableOptions table_options{}; rocksdb::BlockBasedTableOptions table_options{};
table_options.block_cache = cache; table_options.block_cache = cache;
cfo.table_factory.reset(NewBlockBasedTableFactory(table_options)); cfo.table_factory.reset(NewBlockBasedTableFactory(table_options));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -82,6 +82,7 @@ fn main() {
opt.over_provision = true; // large value will use lots of memeory opt.over_provision = true; // large value will use lots of memeory
opt.inline_size = args.blob_size; opt.inline_size = args.blob_size;
opt.tmp_store = args.mode != "get" && args.mode != "scan"; opt.tmp_store = args.mode != "get" && args.mode != "scan";
opt.cache_capacity = 3 << 30;
let mut saved = opt.clone(); let mut saved = opt.clone();
saved.tmp_store = false; saved.tmp_store = false;
let mut db = Mace::new(opt.validate().unwrap()).unwrap(); let mut db = Mace::new(opt.validate().unwrap()).unwrap();