nice crate thanks. I wasn't expecting sqlite to be faster than rocksdb, which is key-value. The way you store the leaves (level, index) should be super fast for a key-value store.
This surprised me too. My guess is that while rocks is typically faster for write-heavy workloads, inserting into the merkle tree actually require a fair few reads as part of the process (but I haven't looked closely).
mmm most of writes and reads (if not all) are batched, meaning a leaf insert triggers just a batched write (containing all updates). maybe there is some fine tunning to be made.