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

Implements get_or_insert for write once workloads. #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 9, 2024

  1. Implements get_or_insert for write once workloads.

    This change allows retrieving values from the map without having to acquire a write lock, unless the value is missing. For read once (or mostly read) workloads this is superior to taking a write lock
    everytime the entry is read. It also saves having to allocate value if it is not inserted and having to compute the usize hash / shard index twice versus the approach of calling get then using entry to insert (as there is not try_insert yet)
    
    Unfortunately, it doesn't seem like it is possible to avoid the second read without changing the behavior of HashMap.
    Matthew Tamayo committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    109bb1a View commit details
    Browse the repository at this point in the history