Skip to content
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

refactor rust part #30

Merged
merged 12 commits into from
Sep 6, 2021
Merged

refactor rust part #30

merged 12 commits into from
Sep 6, 2021

Conversation

kemingy
Copy link
Member

@kemingy kemingy commented Aug 30, 2021

close #26
close #20
close #21
close #22

@kemingy kemingy requested a review from lkevinzc August 31, 2021 04:45
data
}

pub(crate) fn update_multi_tasks(&self, code: TaskCode, ids: &[u32], data: &[Bytes]) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should be able to remove the timeout ids to increase the efficiency. Not sure if it's necessary to do here.

let mut data: Vec<Bytes> = Vec::with_capacity(ids.len());
let table = self.table.read();
// delete the task_id if the task_id doesn't exist in the table
ids.retain(|&id| match table.get(&id) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if retain can get a slight better performance.

src/protocol.rs Outdated Show resolved Hide resolved
src/coordinator.rs Outdated Show resolved Hide resolved
src/protocol.rs Outdated Show resolved Hide resolved
@kemingy kemingy merged commit 25237b4 into main Sep 6, 2021
@kemingy kemingy deleted the issue-26 branch September 6, 2021 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants