OlegDB
OlegDB copied to clipboard
4k align values when stored on disk
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;
}
5c4a5e89fd0a0024a596da9932dc95413221ed46 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:
- 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.
- This will probably reduce the number of page faults we get when trying to access values.