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

Better cht integration #91

Merged
merged 15 commits into from
Mar 21, 2022
Merged

Better cht integration #91

merged 15 commits into from
Mar 21, 2022

Conversation

tatsuya6502
Copy link
Member

This PR will make the interactions between Moka's cache layer and concurrent hash table (cht) layer more efficient.

Including the following changes:

Avoid to update a waiter in the concurrent hash table if it already presents.
- Avoid to update a waiter in the concurrent hash table if it already presents.
- Overall refactoring in cht `bucket` and `bucket_array` modules.
Improve performance on `get_or_insert_with`
- Move code in `cht::segment::map` module to `cht::segment` module.
- Move tests in `cht::test_util::tests` to `cht::segment` module.
- Re-enable tests in `cht::map::bucket` module.
- Fix Clippy warnings in cht tests.
Tweak `use` statements in cht tests.
Refactoring in `cht::*` modules
`invalidate`, etc. methods.

Update crate-internal `cht` methods to take a hash value of the key so
that they do not have to recalculate the hash from the key.
Avoid to calculate the same hash twice in `get`, `insert`, `invalidate`, etc. methods
@tatsuya6502 tatsuya6502 self-assigned this Feb 12, 2022
@tatsuya6502 tatsuya6502 added the enhancement New feature or request label Feb 12, 2022
@tatsuya6502 tatsuya6502 added this to the v0.8.0 milestone Feb 12, 2022
@tatsuya6502 tatsuya6502 marked this pull request as ready for review March 21, 2022 05:04
Copy link
Member Author

@tatsuya6502 tatsuya6502 left a comment

Choose a reason for hiding this comment

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

Merging.

@tatsuya6502 tatsuya6502 merged commit fec6dff into master Mar 21, 2022
@tatsuya6502 tatsuya6502 deleted the better-cht-integration branch March 21, 2022 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant