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

Make the Sorter able to sort in parallel #42

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented Jul 4, 2023

In this PR, I made the Sorter able to sort in parallel in different ways that I documented:

  • Make the sorter able to sort the keys by using rayon
  • Use multiple sorters in parallel to balance the load

About the multi-sorter solution: TBD.

We need to find a way to restrict it a little bit less
src/sorter.rs Outdated
Comment on lines 220 to 222
match number.get() {
1 => ParallelSorter::Single(self.build()),
number => {
Copy link
Member Author

Choose a reason for hiding this comment

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

We must do number - 1 as if we want only 2 threads we will result in the main sending thread and only one sorter which is useless, lets us keep only the single sorter when the number is equal to 2.

@Kerollmops Kerollmops changed the title Make the Sorter able to sorter in parallel Make the Sorter able to sort in parallel Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant