Closed manugoyal closed 7 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.
Solved with re-implementation of upsert.
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.