If we end up "merging" deleted records, then we'll have huge records, and it'll be slow to check whether all the next (suppose) 50MB are zero bytes.
Instead what we can do is pass in an option to customize isBufferZero, similar to how we have opts.validateRecord that is passed in. This way, ssb-db2 could pass in a custom isBufferZero which just checks the first 10 bytes whether they are zero or not, because I suspect we never have an ssb-db2 record in the log where the first 10 bytes are zero and the next bytes after that are non zero.
I had an idea to improve the performance of this.
If we end up "merging" deleted records, then we'll have huge records, and it'll be slow to check whether all the next (suppose) 50MB are zero bytes.
Instead what we can do is pass in an option to customize isBufferZero, similar to how we have
opts.validateRecord
that is passed in. This way, ssb-db2 could pass in a customisBufferZero
which just checks the first 10 bytes whether they are zero or not, because I suspect we never have an ssb-db2 record in the log where the first 10 bytes are zero and the next bytes after that are non zero.