diff options
author | Kim Alvefur <zash@zash.se> | 2021-05-11 02:09:56 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-05-11 02:09:56 +0200 |
commit | 74ea750bc4cb3390c84b193036339aa3d2e69272 (patch) | |
tree | 22747938e8a5399db7f406db8a25aa3a918493bc /util/helpers.lua | |
parent | cddd0748a06407e4943689a42db89d2c197295fa (diff) | |
download | prosody-74ea750bc4cb3390c84b193036339aa3d2e69272.tar.gz prosody-74ea750bc4cb3390c84b193036339aa3d2e69272.zip |
util.datamanager: Add O(1) list indexing with on-disk index
Index file contains offsets and lengths of each item() which allows
seeking directly to each item and reading it without parsing the entire
file.
Also allows tricks like binary search, assuming items have some defined
order.
We take advantage of the 1-based indexing in tables to store a magic
header in the 0 position, so that table index 1 ends up at file index 1.
Diffstat (limited to 'util/helpers.lua')
0 files changed, 0 insertions, 0 deletions