Currently, the WriteBatch follows the original implementation of leveldb, which is a Vec<u8> with encoded entries. When we call put, the entry will be encoded into variant length based encoded bytes, fill the bytes into a WriteBatch and then be inserted into MemTable, However, when inserting the batch into MemTable, it needs to be decoded into entires first.
For a more efficient inserting style, we might just let WriteBatch hold unencoded entries, and deliver them to the MemTable without any serde.
Currently, the
WriteBatchfollows the original implementation of leveldb, which is aVec<u8>with encoded entries. When we callput, the entry will be encoded into variant length based encoded bytes, fill the bytes into aWriteBatchand then be inserted intoMemTable, However, when inserting the batch intoMemTable, it needs to be decoded into entires first.For a more efficient inserting style, we might just let
WriteBatchhold unencoded entries, and deliver them to theMemTablewithout any serde.