-
Notifications
You must be signed in to change notification settings - Fork 130
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 index of internal blocks #410
Conversation
there is no need to add complexity everywhere, you can easily just hide index in tree insert, remove and search function, for example:
and you can do block_remove the same way like example above |
Yes, good suggestion. If we name it as stage 1.0 for the previous implementation, this is stage 1.5, not stage 2.0 yet. After this version, I will try to introduce a new cache mechanism to switch cold/hot data in RAM to reduce page faults. As the cache usage is quite low when do syncing, switch cold/hot data would give another boost of performance. |
memcpy(block_array + n, br->backrefs, i * sizeof(struct block_internal *)); | ||
|
||
int j = 0; | ||
for(j = 0; j < i; j++) { |
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.
Can you just use for(int j = 0; j < i; j++)
?
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.
Sure, any other comments with this PR?
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.
Waiting for index to be hidden in tree functions to keep the code tidy (and to avoid to add possible bugs in all that tricky changes with index->bi... )
@sgaragagghu |
It's based on #409
Create index for all internal blocks in RAM with hash and address of internal blocks to avoid too many page faults when doing rbtree searches, since internal blocks are stored in mmap memory which is actually on disk . It will take about 5G extra RAM when use tmp files, but speed up the loading and syncing process, performance is similar with -z RAM option.
With 8G RAM and SSD, it will take about 7 hours to load storage, syncing is still in testing right now.