pdqsort
ips4o
pdqsort | ips4o | |
---|---|---|
9 | 2 | |
2,288 | 159 | |
- | - | |
0.0 | 1.8 | |
5 months ago | over 3 years ago | |
C++ | C++ | |
zlib License | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pdqsort
- Pattern-Defeating Quicksort (Pdqsort)
-
Faster sorting algorithm
I found that this exists: https://github.com/orlp/pdqsort
-
How sorting algorithms work
Their sort_unstable algorithm is based on this pattern-defeating quicksort.
-
Timsort – the fastest sorting algorithm you’ve never heard of
Closely related is pattern defeating quicksort ( https://github.com/orlp/pdqsort ), which adapts quicksort to take advantage of sorted runs. I've adapted a few quicksorts to pdqsort and seen good speedups (as people were often sorting partially sorted data)
Basically: Timsort is to mergesort as pdqsort is to quicksort
- I tried creating a sorting algorithm in C language.
- Do Low-Level Optimizations Matter?
-
Discussion Thread
I was thinking of optimal C++ over native types. I just spoke up because if your intuition of quicksort is that 50k elements should take 20ms you’re drastically underestimating computer performance. They’re crazy fast and optimized sorting algorithms are downright scary.
-
Beating Up on Qsort (2019)
Just for fun, I added pdqsort to the benchmark:
https://github.com/orlp/pdqsort
Here are some of the results on an Ivy Bridge hackintosh:
size, qsort, inline, sort, stable_sort, pdqsort, radix7
-
Which sorting algorithm did you implement in your programming language?
sort_unstable is a pattern-defeating quicksort (https://github.com/orlp/pdqsort) added with RFC#1884 (https://github.com/rust-lang/rfcs/pull/1884).
ips4o
-
Hoare’s Rebuttal and Bubble Sort’s Comeback
A while ago I was tinkering with Quicksort and avoiding branch mispredictions.
https://easylang.online/blog/qsort_c.html
My implementation is pretty fast. At a size of 40 or 50, I switch to Insertion sort, and there the branchless bubblesort is significantly slower (I just tried it).
But I have to admit defeat to this SampleSort:
https://github.com/SaschaWitt/ips4o
-
Do Low-Level Optimizations Matter?
For sorting, not really. The big development in compute power is parallelism. ips4o facto (https://github.com/SaschaWitt/ips4o), if you want to sort large vectors really fast it makes more sense to sort in-place and in parallel. Parallel in-place radix sort is also choice, but way less flexible than comparison sort.
What are some alternatives?
fluxsort - A fast branchless stable quicksort / mergesort hybrid that is highly adaptive.
cpp-sort - Sorting algorithms & related tools for C++14
American Fuzzy Lop - american fuzzy lop - a security-oriented fuzzer
root - The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
quadsort - Quadsort is a branchless stable adaptive mergesort faster than quicksort.
quicksort-blog-post
ZBar - Clone of the mercurial repository http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar
nytm-spelling-bee - Generate anagram puzzles like Frank Longo's "Spelling Bee" as in New York Times Magazine
ZXing - ZXing ("Zebra Crossing") barcode scanning library for Java, Android
LightGBM - A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
C++ Format - A modern formatting library
Taskflow - A General-purpose Parallel and Heterogeneous Task Programming System