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

find_fn vs. update_fn #151

Open
Jiboxiake opened this issue Dec 15, 2022 · 2 comments
Open

find_fn vs. update_fn #151

Jiboxiake opened this issue Dec 15, 2022 · 2 comments

Comments

@Jiboxiake
Copy link

Hello, I am trying to find out the most performant hashmap for my project and I came across yours. I have a small question. I find two functions, one is find_fn and the other is update_fn. I believe the designers want only update_fn to have a function able to modify the entry's contents. However, I'm wondering if my entry stores std::atomic objects. Are updates to those entries allowed in find_fn? Because I feel it will be more performant. �Thanks.

@manugoyal
Copy link
Contributor

Hi @Jiboxiake. find_fn and update_fn are essentially the same thing, except that find_fn is a const method, so only it can be invoked on a const hashtable. Performance-wise, they should be equivalent.

@Jiboxiake Jiboxiake reopened this Dec 26, 2022
@Jiboxiake
Copy link
Author

Hello, but I thought find_fn is a read access and update_fn is a write access? Thanks.

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

No branches or pull requests

2 participants