(tokio-util JoinMap) Remove raw-entry feature in favour of HashTable API. #7252
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
While rebasing #7075, I noticed the change from #7219 which updates hashbrown, requiring the addition of the
raw-entry
feature. That inspired me to take a look at the actual JoinMap impl and I thought it could be improved by usingHashTable
instead.Solution
Replacing the
tasks_by_key
map with aHashTable
, we unlock a few benefits:tasks_by_key
, since we can fetch the ID from theAbortHandle
.S: BuildHasher
, as we are in-control over the hash-function, we can fetch the existing hasher fromhashes_by_task
.However, removing the ID from
tasks_by_key
will slow down those lookups (only injoin_next()
), as they now need a vtable lookup, rather than comparing against the id already in the current cache line.I don't feel strongly about this PR, I'm just quite fond of the HashTable API and thought I'd try it here.