infoforcefeed / OlegDB

Enough works to use this in production

Home Page:http://olegdb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

4k align values when stored on disk

qpfiffer opened this issue · comments

Values stored in the values file should be padded with extra space (at least 4k) to reduce page faults. This will also allow some headroom on updates.

Probably something like this:

int padded_size(const int size) {
    return (size + 4095) & ~4095;
}

5c4a5e8 adds the helper method to compute the padded value but it isn't used anywhere.

And because keep forgetting why I created this ticket, it has at least two merits:

  1. Adding extra padding reduces the need to append new values to the end of the values file because we have some leeway to work with. This also reduces empty pockets in the values file. I can explain more about this if anyone cares.
  2. This will probably reduce the number of page faults we get when trying to access values.