Closed faddat closed 9 months ago
All I can say is:
Attention: 97 lines
in your changes are missing coverage. Please review.
Comparison is base (
b15320b
) 77.53% compared to head (070a044
) 73.98%.
faddat@Whites-MacBook-Pro cometbft-db % GOARCH=arm64 go test -bench=BenchmarkPebbleDBvsGoLevelDB goos: darwin goarch: arm64 pkg: github.com/cometbft/cometbft-db BenchmarkPebbleDBvsGoLevelDB/PebbleDB-8 322890 3930 ns/op BenchmarkPebbleDBvsGoLevelDB/GoLevelDB-8 315639 4425 ns/op PASS ok github.com/cometbft/cometbft-db 7.470s
faddat@Whites-MacBook-Pro cometbft-db % GOARCH=arm64 go test -bench=BenchmarkPebbleDBvsGoLevelDB goos: darwin goarch: arm64 pkg: github.com/cometbft/cometbft-db BenchmarkPebbleDBvsGoLevelDB/PebbleDB-8 348592 3866 ns/op BenchmarkPebbleDBvsGoLevelDB/GoLevelDB-8 307240 4261 ns/op PASS ok github.com/cometbft/cometbft-db 7.409s
However if tested against iavl, this would be even more superieor.
Please use this mainly for the benchmarks as I think I made a kind of significant finding here with regard to high bandwidth situations.
TO: Maintainer -
please run the benchmarks I think they could explain some recent stuff.
I'll pull benchmarks from here.
to: maintiner (idk who this is) please run benchmarks on a solidly fast machine.
I fear if we don't it wont match the real world.
In general the benchmarks will exceed what a normal computer can do. my 64gb macbook pro handles it well. I could reduce the size of values, which I am somewhat guessing on, and increase the number of keys. The critical thing to note is that
go test -bench=.
goos: darwin
goarch: arm64
pkg: github.com/cometbft/cometbft-db
BenchmarkGoLevelDBRandomReadsWrites-12 374047 3878 ns/op
BenchmarkMemDBRangeScans1M-12 1087 1122654 ns/op
BenchmarkMemDBRangeScans10M-12 1060 1126530 ns/op
BenchmarkMemDBRandomReadsWrites-12 1000000 2080 ns/op
BenchmarkDB/Keys_10000_Values_512_pebbledb-12 1000000000 0.03704 ns/op
BenchmarkDB/Keys_10000_Values_512_goleveldb-12 1000000000 0.05867 ns/op
BenchmarkDB/Keys_10000_Values_1024_pebbledb-12 1000000000 0.03695 ns/op
BenchmarkDB/Keys_10000_Values_1024_goleveldb-12 1000000000 0.08461 ns/op
BenchmarkDB/Keys_10000_Values_2048_pebbledb-12 1000000000 0.03693 ns/op
BenchmarkDB/Keys_10000_Values_2048_goleveldb-12 1000000000 0.1145 ns/op
BenchmarkDB/Keys_10000_Values_4096_pebbledb-12 1000000000 0.04425 ns/op
BenchmarkDB/Keys_10000_Values_4096_goleveldb-12 1000000000 0.2443 ns/op
BenchmarkDB/Keys_25000_Values_512_pebbledb-12 1000000000 0.08316 ns/op
BenchmarkDB/Keys_25000_Values_512_goleveldb-12 1000000000 0.1817 ns/op
BenchmarkDB/Keys_25000_Values_1024_pebbledb-12 1000000000 0.07789 ns/op
BenchmarkDB/Keys_25000_Values_1024_goleveldb-12 1000000000 0.2394 ns/op
BenchmarkDB/Keys_25000_Values_2048_pebbledb-12 1000000000 0.07354 ns/op
BenchmarkDB/Keys_25000_Values_2048_goleveldb-12 1000000000 0.3182 ns/op
BenchmarkDB/Keys_25000_Values_4096_pebbledb-12 1000000000 0.07995 ns/op
BenchmarkDB/Keys_25000_Values_4096_goleveldb-12 1 1674754750 ns/op
BenchmarkDB/Keys_50000_Values_512_pebbledb-12 1000000000 0.1466 ns/op
BenchmarkDB/Keys_50000_Values_512_goleveldb-12 1000000000 0.3238 ns/op
BenchmarkDB/Keys_50000_Values_1024_pebbledb-12 1000000000 0.1558 ns/op
BenchmarkDB/Keys_50000_Values_1024_goleveldb-12 1000000000 0.4517 ns/op
BenchmarkDB/Keys_50000_Values_2048_pebbledb-12 1000000000 0.1485 ns/op
BenchmarkDB/Keys_50000_Values_2048_goleveldb-12 1000000000 0.7940 ns/op
BenchmarkDB/Keys_50000_Values_4096_pebbledb-12 1000000000 0.1651 ns/op
BenchmarkDB/Keys_50000_Values_4096_goleveldb-12 1 1899533750 ns/op
BenchmarkDB/Keys_75000_Values_512_pebbledb-12 1000000000 0.2108 ns/op
BenchmarkDB/Keys_75000_Values_512_goleveldb-12 1000000000 0.4588 ns/op
BenchmarkDB/Keys_75000_Values_1024_pebbledb-12 1000000000 0.2225 ns/op
BenchmarkDB/Keys_75000_Values_1024_goleveldb-12 1000000000 0.7332 ns/op
BenchmarkDB/Keys_75000_Values_2048_pebbledb-12 1000000000 0.2192 ns/op
BenchmarkDB/Keys_75000_Values_2048_goleveldb-12 1 1429007458 ns/op
BenchmarkDB/Keys_75000_Values_4096_pebbledb-12 1000000000 0.2486 ns/op
BenchmarkDB/Keys_75000_Values_4096_goleveldb-12 1 3416400792 ns/op
BenchmarkDB/Keys_100000_Values_512_pebbledb-12 1000000000 0.2646 ns/op
BenchmarkDB/Keys_100000_Values_512_goleveldb-12 1000000000 0.6500 ns/op
BenchmarkDB/Keys_100000_Values_1024_pebbledb-12 1000000000 0.3111 ns/op
BenchmarkDB/Keys_100000_Values_1024_goleveldb-12 1 1034177375 ns/op
BenchmarkDB/Keys_100000_Values_2048_pebbledb-12
pebble is in general many times faster.
Ulike goleveldb, pebble is maintained.
sometimes pebble is a few million times faster.
Flakiness, anyone?
the big worry here is that goleveldb does not act in a predictable manner.
preparing a branch of cometbft's main to see if we can eliminate time based flakiness with pebble.
I'm a fan. How is pebbleDB handling workload in Berachain?
Really wish you didn't do unnecessary changes here so we could review it easier. But aside from that, concept ACK and we'll review this ASAP, thanks for patience!
Closing in favor of https://github.com/cometbft/cometbft-db/pull/112. Let's focus on a single PR. After it's merged, we can do linting.
Closes: #90