Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve memory efficiency of EntityCache #3594

Merged
merged 8 commits into from
Aug 23, 2022
Merged

Improve memory efficiency of EntityCache #3594

merged 8 commits into from
Aug 23, 2022

Conversation

lutter
Copy link
Collaborator

@lutter lutter commented May 25, 2022

This PR makes the EntityCache more memory efficient, meaning the same amount of memory will be able to store more entities with two changes:

  • Use Word (Box<str>) for entity types and ids
  • Remove the subgraph id from EntityKey since that adds an overhead of 70 bytes for every cache entry

Copy link
Collaborator

@leoyvens leoyvens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm, good thing we didn't have EntityKey in the actual ProofOfIndexingEvent. The change is very mechanical but it touches many critical pieces of the code, so might be worth an integration cluster run.

@lutter
Copy link
Collaborator Author

lutter commented Aug 23, 2022

I ran this in the integration cluster for > 24hrs without any incident. Merging it therefore

@lutter lutter merged commit 1d4f8d4 into master Aug 23, 2022
@lutter lutter deleted the lutter/word branch August 23, 2022 23:38
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