holiman / billy

Very simple datastore
BSD 3-Clause "New" or "Revised" License
55 stars 8 forks source link

Support linearly increasing bucket sizes #1

Closed karalabe closed 1 year ago

karalabe commented 1 year ago

First!

For blob transactions, the sizes will be multiples of 128KB, not powers of 2. Might be significantly less wasteful if we could have an option to initialize the buckets with a linear increase?

holiman commented 1 year ago

Yeah, so linearly is one options -- but one might want to let this be totally determined from the outside. If the sizes are a bell-curve around 128K, or some sort of not strictly linear distribuiton, you might want to have more granular buckets around the center (or minimum), and towards the upper limit have them more sparse.

With more buckets, should also make the "what bucket to use" into a binary search instead of for-loop.