• Kirill Smelkov's avatar
    go/zodb/fs1: BTree specialized with KEY=zodb.Oid, VALUE=int64 · 33d10066
    Kirill Smelkov authored
    FileStorage index maps oid to file position storing latest data record
    for this oid. This index is naturally to implement via BTree as e.g.
    ZODB/py does.
    
    In Go world there is github.com/cznic/b BTree library but without
    specialization and working via interface{} it is slower than it could be
    and allocates a lot. So generate specialized version of that code with
    key and value types exactly suitable for FileStorage indexing.
    
    We use a bit patched b version with speed ups for bulk-loading data via
    regular point-ingestion BTree entry point:
    
    	https://lab.nexedi.com/kirr/b x/refill
    
    The patches has not been upstreamed because it slows down general case a
    bit (only a bit, but still this is a "no" to me), and because with
    dedicated bulk-loading API it could be possible to still load data
    several times faster. Still current version is enough for not very-huge
    indices.
    
    Btw ZODB/py does the same (see fsBucket + friends).
    33d10066
fsbtree_util.go 1.76 KB