-
Notifications
You must be signed in to change notification settings - Fork 648
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
Add new direct index type #1462
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, i didn't made speed comparison but replayed fully. all test cases passing. nice work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good at a glance.
- better also use this new index for
account_statistics_object
,asset_dynamic_data_object
and etc - hard-coded chunk sizes are fine so far, perhaps can change them to configurable in the future
- test cases?
- new hole over several chunks (in case when chunk size is too small, although perhaps we won't use it this way)
These are currently using
Agree. Chunk size is a minor optimization factor anyway. Need to find a balance between number of chunks and wasted memory due to chunk remaining almost empty.
This ensures that a hole cannot span several chunks:
Will add a unit test for some basics. |
Sorry I overlooked those. I agree that chunk size is a minor optimization factor, since 1M items per chunk means 8MB of RAM which is not big. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, account_balance index
if applicable can be discussed and done in a new issue.
Already working on account_balance :-) |
Done. Replay of 32M blocks now takes only a little more than one hour. |
Made snapshot comparison with base. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for confirming with snapshot, test cases all working, code looks good. great addition.
Thanks! |
Added a secondary index that allows O(1) access to objects based on their ID. Mostly useful for accounts and assets.
Speeds up replay by 25% in my tests. :-)