-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(server): flush slots traverse better yield #4821
Conversation
Signed-off-by: adi_holden <[email protected]>
src/server/db_slice.cc
Outdated
int64_t exec_time_ms = (after - start) / 1000000; | ||
if (exec_time_ms > 10) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIce, as discussed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10ms is a lot, imho. why not reduce to 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok we can do 1ms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romange do we have anything cheaper than GetCurrentTimeNanos(), because we need ms precision
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think GetCurrentTimeNanos() is ok here, given that we do not run the function frequently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/server/db_slice.cc
Outdated
if (i % 100 == 0) { | ||
int64_t after = absl::GetCurrentTimeNanos(); | ||
int64_t exec_time_ms = (after - start) / 1000000; | ||
if (exec_time_ms > 10) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we use micro in all of our statistics maybe worth keeping that unit ?
src/server/db_slice.cc
Outdated
auto iterate_bucket = [&](PrimeTable::bucket_iterator it) { | ||
it.AdvanceIfNotOccupied(); | ||
while (!it.is_done()) { | ||
del_entry_cb(it); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
del_entry_cb is redundant now. why not move its implementation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, this was just easy for me to test this with moving back and forward with TraverseBuckets/Traverse to see the impact of this change
src/server/db_slice.cc
Outdated
@@ -787,13 +787,16 @@ void DbSlice::Del(Context cntx, Iterator it) { | |||
} | |||
|
|||
void DbSlice::FlushSlotsFb(const cluster::SlotSet& slot_ids) { | |||
VLOG(3) << "Start FlushSlotsFb"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest making it 2 or even 1, because it's not often operation
Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🇮🇹 👩🍳
Signed-off-by: adi_holden <[email protected]>
No description provided.