efficient / libcuckoo

A high-performance, concurrent hash table
Other
1.62k stars 275 forks source link

upsert inefficiency #31

Closed manugoyal closed 7 years ago

manugoyal commented 8 years ago

When you do an upsert, first we try an update, then an insert if the update fails. But when doing the insert, we don't need to scan the whole bucket to check for duplicates, because we just tried doing an update. So ideally the insert would just look for a free slot in either of the buckets and return immediately.

MRYingLEE commented 8 years ago

I just implemented upsert in another way. The new implementation should have better efficiency.

I have created pull request. I also uploaded the code and examples to my fork, https://github.com/MRYingLEE/libcuckoo-transaction.

The new implementation uses the name of update_or_insert.

manugoyal commented 7 years ago

Solved with re-implementation of upsert.