mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 08:10:50 +00:00
boltDB's bucket.Put() is quadratic on "new keys put into a bucket during this transaction", which is why BoltDB has warnings not to use it with over 100k new keys at a time. The translation store logic wasn't actually using that. The actual value picked is smaller, based on some half-baked benchmarking. We also avoid heap-allocating separate 16-byte (not 8-byte, of course, because make(...) is *helping*) chunks twice for each key we insert, instead allocating a single buffer which we reuse for each new transaction. Also fixed a check against the nilness of the wrong pointer and generally made CreateKeys and TranslateKeys a little more similar. |
||
|---|---|---|
| .. | ||
| attrstore.go | ||
| translate.go | ||
| translate_test.go | ||