4k align values when stored on disk
qpfiffer opened this issue · comments
Quinlan Pfiffer commented
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.
Quinlan Pfiffer commented
Probably something like this:
int padded_size(const int size) {
return (size + 4095) & ~4095;
}
Quinlan Pfiffer commented
5c4a5e8 adds the helper method to compute the padded value but it isn't used anywhere.
Quinlan Pfiffer commented
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.