Skip to content

Avoid hashing for single-entry maps#316

Merged
cuviper merged 1 commit intoindexmap-rs:masterfrom
cuviper:trivial-search
Feb 26, 2024
Merged

Avoid hashing for single-entry maps#316
cuviper merged 1 commit intoindexmap-rs:masterfrom
cuviper:trivial-search

Conversation

@cuviper
Copy link
Member

@cuviper cuviper commented Feb 25, 2024

We already avoid hashing for get/remove on empty maps, but we can also
do this for single-entry maps. Even with a cheap hash function, a single
equality check ought to be faster than any hash table lookup.

We already avoid hashing for get/remove on empty maps, but we can also
do this for single-entry maps. Even with a cheap hash function, a single
equality check ought to be faster than any hash table lookup.
@cuviper cuviper added this pull request to the merge queue Feb 26, 2024
Merged via the queue into indexmap-rs:master with commit e0a7f23 Feb 26, 2024
@cuviper cuviper deleted the trivial-search branch February 27, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant