Skip to content

Conversation

@hagen-i2p
Copy link

Patch to store peer profiles in one text file as json-hash-per-line

  • Greatly saves disk space, reduces inode usage and fs writes (from 880Mb dir with ~210k 4k-files -> one file about 20Mb in my case)
  • No extra deps: uses same boost/property_tree/json_parser as in I2PControl service
  • Atomic database save: uses save-then-replace method

Drawbacks:

  • In theory it uses slightly more memory just after start (as all known profiles loaded at startup). From the other side, profiles considered "useless" or "expired" will not be saved and live only in memory.
  • No lazy save/load for individual profile, all profiles saved at once with PEER_PROFILE_AUTOCLEAN_TIMEOUT interval (6h for now, may be tuned later)

@wekoq
Copy link
Contributor

wekoq commented May 19, 2023

I think, IsUseful can be inline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants