OlegDB icon indicating copy to clipboard operation
OlegDB copied to clipboard

4k align values when stored on disk

Open qpfiffer opened this issue 10 years ago • 3 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.

qpfiffer avatar Jul 02 '14 18:07 qpfiffer

Probably something like this:

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

qpfiffer avatar Jul 02 '14 23:07 qpfiffer

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

qpfiffer avatar Sep 09 '14 13:09 qpfiffer

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.

qpfiffer avatar Sep 19 '14 18:09 qpfiffer