IntersectMBO / lsm-tree

A Haskell library for on-disk tables based on LSM-Trees
Apache License 2.0
28 stars 7 forks source link

Record assumptions about disk page size in one central location #143

Open jorisdral opened 7 months ago

jorisdral commented 7 months ago

There are a few parts of the code that assume the the disk page size is 4096. We should record this number in a central place. This should also make it easier for us to support larger page sizes later

Example: https://github.com/IntersectMBO/lsm-tree/pull/130/files#diff-259998897e992a96628fa4b64af4e2b100710b2c69a01497d0158abc3f0a98b9R156-R163

mheinzel commented 7 months ago

So the goal of this is not to already already allow changing the number (with things still working), but to make it easy to find all places that would need to change, right? So all usages of a pageSize constant would be easy to find. Other places (like the example linked above) might not easily be changed to use the constant, but we could have a convention to at least include an assert or comment mentioning the assumption pageSize == 4096.