Regarding erased_key_sentinel in static map #600
-
Opened on behalf of @avithemad. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
From @avithemad:
The Bloom filter can probably fit into the L2$ so the lookup is considerably faster compared to the map lookup. It is a common practice to pre-filter the keys before performing the hash map lookup in cases where the matching rate is very low. So you did the right thing. BTW we do have a |
Beta Was this translation helpful? Give feedback.
-
I just ran a benchmark on my L40s testing the lookup performance of Benchmark Resultsstatic_multimap_query_uniform_matching_rate[0] NVIDIA L40S
As you can see, the lookup performance is even higher if the matching rate is low.
If you want to play around with the benchmark axes for e.g.
Depending on your input key distribution, this could certainly impact performance. Let's say your keys are a dense contiguous sequence (sorted or not), then with Another factor that might impact performance is the load factor of the map. The more occupied the map is, the lower the chance of finding an empty slot. What's the map's occupancy for your current setup? |
Beta Was this translation helpful? Give feedback.
-
@sleeepyjack , I think I cannot resolve this discussion (Don't see any option to do so). Thank you. |
Beta Was this translation helpful? Give feedback.
I think I got the reason. The hash table they implement in crystal is just 1D array similar to a bloom filter, therefore they get comparable performance. I think this performance of empty probe is reasonable assuming uniform distribution of probing.
Thank you for clarifying about the performance.