-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
merging maps #234
Comments
Hi @gf777 , You have the right idea, and indeed for your purpose this would work very well. The two tables to merge would have to have the same So say you are using
|
Thanks for the prompt feedback @greg7mdp
Error: I tried a number of things with .insert and .find but to no avail.. |
Apparently this works (verbose though) |
One more question: if I now want to increase the number of maps in the template, say when I declare it here: |
Hum, did you find the answer to your question? I was looking in Let me know if you have any other question, I'm happy to help. |
This seems to work like a charm, thanks! I would go as far as saying that it should be a core function XD
I noticed you have some calculations in the readme as well. Thoughts? |
Correct size is:
Map is in essence an array of values + an array of bytes (hence the |
terrific! It seems to be working well |
Hi @greg7mdp,
First of all thank you very much for providing this hash map, it's extremely efficient!
I would like to know if there is a way to do the following with the current functions.
Imagine you have to merge multiple hash tables that you generated with parallel-hashmap. The way I am currently doing this is that I load two tables at a time, then go through each key of the smaller table and insert it into the larger one. Now, with the code provided here https://greg7mdp.github.io/parallel-hashmap/ one can easily see how this can be multithreaded by having each thread checking a different hash however each thread still has to go through all keys (even though skipping many of them). It seems to me that it would be much more efficient if the threads could have access directly to the submaps and could merge them concurrently. Each thread would immediately know which hashes to check (only those of the assigned hashmap). It would be efficient also memory-wise because once the merge of one submap is done, the submap could even be deleted. Is that reasonable/doable?
Thank you in advance
The text was updated successfully, but these errors were encountered: