Skip second _find_key for ReadWrite #222
bpmckinnon
started this conversation in
Ideas
Replies: 1 comment
-
That's an interesting idea, but I'm not sure it would be much faster. I think the overhead for doing the find again is quite low. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure about the internals for how memory is flagged as available, but right now when using the ReadWrite lock if the switch_to_unique returns true, then _find_key is run again. Would it make sense to
store the capacity (or pointer) of the set
do _find_key
if offset is valid
switch the lock to writer
if the capacity (or pointer) has changed or the entry at offset no longer matches
repeat _find_key
Then you wouldn't have to repeat the find unless your data has been invalidated.
Beta Was this translation helpful? Give feedback.
All reactions