5 ms·
These are actually some really good numbers for a certain application I'm looking at (https://news.ycombinator.com/item?id=24191307 https://news.ycombinator.com
by koeng 6y ago
These are actually some really good numbers for a certain application I'm looking at (https://news.ycombinator.com/item?id=24191307 https://news.ycombinator.com/item?id=24191307), especially with bulk inserts being so high.
A few questions:
- Why 255 bytes to 255 bytes? Does this have any performance consequences?
- Your laptop is SSD right?
- Is there any more documentation on how to use Kivaloo? (not just facts about it)
- cperciva 6y agoThe 255 byte limit is because I store keys and values as a one-byte length followed by the relevant data. For Tarsnap what I typically want is ~40 byte keys and data (hence using those sizes for benchmarking). Yes, my laptop has a Intel 660p 512 GB NVMe disk. No documentation per se, although I hope the library interfaces are reasonably understandable. I'd be happy to help though -- this code deserves to be used!
- morelisp 6y agoIs the one-byte length central to some logic (or some performance concerns), or could one hack the `uint8_t` to a `uint16_t` in kvldskey and so on to get something that could store a bit more? We have some systems that need only 16-32 byte keys but upwards of around 16k values, we're currently using RocksDB but these performance numbers + no compaction process + mux approach are making me interested...
- cperciva 6y agoInteresting question. You would need to adjust kvldskey and all of the places where they are serialized (e.g. in pages and in the network protocol). You would also need a much larger page size -- the maximum key+value pair size has to fit into 1/3 of a page. But if you're willing to make those adjustments and use 64 kB pages, I imagine it would work just fine. Please stay in touch!
- exikyut 6y agoForgive my complete ignorance/inexperience, but why does the page size need to be increased to 64kB, and why does the key+value length(?) have to fit into 1/3 of a page?
- cperciva 6y agoB+Tree leaf nodes contain keys and values. In kvlds (which is the core B+Tree component of kivaloo), the code aims to keep nodes at least 2/3 full, in order to keep the tree approximately balanced. If a key-value pair can take more than 1/3 of a page, you could have a situation where a node is less than 2/3 of a page but adding another key-value pair would take it above the maximum allowed size. This restriction could be relaxed, e.g. to require only that internal nodes are at least 2/3 full, in which case for the small key / large value case you could have pages which are barely larger than the largest value. I didn't bother doing that since it wasn't relevant to my usage.