-
Notifications
You must be signed in to change notification settings - Fork 61
Parallel sort via tbb #844
Parallel sort via tbb #844
Conversation
Hello @AlexanderKalistratov! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-01 20:07:41 UTC |
954ccf3
to
27d02b4
Compare
Still need to update setup, requirements, conda recipe, whatever to add dependency for tbb-devel |
sdc/native/sort.cpp
Outdated
break; | ||
default: | ||
// fallback to c qsort? | ||
if (size < 4) run_sort(_void_range<4>) |
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.
<=
template<class T> | ||
inline void merge_sorted_main_loop(buffer_queue<T>& left, buffer_queue<T>& right, buffer_queue<T>& out, void* compare = nullptr) | ||
{ | ||
if (compare) |
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 can write this shorter, like
auto less = compare ? reinterpret_cast<compare_func>(compare) : [](T* r, T* l){ return *r < *l; }
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.
calling comapre
instead of using simple <
causes 20-30% of performance degradation
sdc/native/utils.cpp
Outdated
void set_threads_num(uint64_t threads) | ||
{ | ||
get_arena().initialize(threads); |
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'm not sure it is going to work as intended. IMO Better to just save value to global variable here and than pass this var into arena ctor.
static tbb::task_arena arena(num_threads);
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.
Watched.
No description provided.