-
Notifications
You must be signed in to change notification settings - Fork 90
Change doubly LL to singly LL in hash table #15
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
base: master
Are you sure you want to change the base?
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.
Run clang-format -i *.[ch]
for consistent style.
struct ht_node *tmp = list_element(iter, struct ht_node, list); | ||
struct hlist_head *head = &h->buckets[bkt]; | ||
struct hlist_node *iter; | ||
hlist_for_each(iter, head) |
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.
Update .clang-format
to recognize hlist_for_each
as a for-each macro.
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.
Done!
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.
You shall indent this source file accordingly.
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.
Read https://cbea.ms/git-commit/ carefully and refine your git commit messages.
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.
Improve git commit messages. You should summarize the motivation and consideration to make such changes. In addition, the subject ought to be revised.
There'll be errors occur when having an input like this: |
Would you continue working on this pull request? |
Yes, I’ll continue to work on it. |
@iLeafy11, I look forward to your work. Feel free to submit further commits. |
According to Execution time comparison (32 runs):
The hlist version having slightly worse execution time, so I took a deeper look into cache behavior: Cache performance:
This indicates that the hlist version has a cache performance advantage. However, its performance is likely hurt by branching overhead introduced in if (!tail)
hlist_add_head(...);
else
hlist_add_behind(...); Therefore, I'm unsure whether this direction is worth continuing. |
No description provided.