Quicksort Blog Post

Alternatives To Quicksort Blog Post
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Leveldb32,731311 days ago1February 27, 2018280bsd-3-clauseC++
LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
Fashion Mnist9,856
a year ago24mitPython
A MNIST-like fashion product database. Benchmark :point_down:
Node Timsort191141,5891653 years ago5July 24, 201614mitJavaScript
Tim Sort implementation for Node.js
Ulid Creator154
a month ago27August 21, 2022mitJava
A Java library for generating Universally Unique Lexicographically Sortable Identifiers (ULID)
Testingrng118
9 months ago7apache-2.0C++
Testing common random-number generators (RNG)
Omgopass11152 years ago9August 05, 2020mitJavaScript
*️⃣ A tiny memorable password generator for Node.js and browsers
Normaldist Benchmark78
8 years ago1mitC
Normally Distributed Random Number Generator Benchmark
Chembench32
a year ago2otherHTML
MoleculeNet benchmark dataset & MolMapNet dataset
Quicksort Blog Post26
2 years agoapache-2.0C++
Drnglib25
210 years ago3June 12, 2013otherJava
drnglib is a Java library that provides access to Intel's Digital Random Number Generator.
Alternatives To Quicksort Blog Post
Select To Compare


Alternative Project Comparisons
Readme

Branchfree QuickSort performance analysis

This is not an officially supported Google product

This directory contains code and benchmarks accompanying the blog post about QuickSort performance.

The main() function validates the correctness of the main algorithms before running benchmarks.

The benchmark requires Bazel to build. At build time Bazel will automatically download and build the benchmarking framework.

From this directory, run:

$ CC=clang bazel build -c opt :bench_sort
$ ../bazel-bin/quicksort-blog-post/bench_sort

The versions of gcc I've run did not lower conditionals into branchfree code.

Overview of benchmarks

Random int's

Benchmark                                          Time           CPU Iterations
---------------------------------------------------------------------------------
BM_Sort<std::sort>                                79 ns         78 ns    9300000
BM_Sort<std::stable_sort>                         90 ns         90 ns    7400000
BM_Sort<std_heap_sort>                           130 ns        130 ns    4600000
BM_Sort<andrei::sort>                             52 ns         52 ns   15100000
BM_Sort<exp_gerbens::QuickSort>                   30 ns         30 ns   24700000
BM_Sort<pdqsort>                                  42 ns         42 ns   16800000
BM_Sort<HeapSort>                                 51 ns         51 ns   14500000

Random pointers sort on address (0 levels of indirection)

Benchmark                                              Time           CPU Iterations
---------------------------------------------------------------------------------
BM_IndirectionSort<0, std::sort>                      77 ns         77 ns    9200000
BM_IndirectionSort<0, std::stable_sort>               92 ns         91 ns    7600000
BM_IndirectionSort<0, std_heap_sort>                 124 ns        124 ns    5800000
BM_IndirectionSort<0, andrei::sort>                   56 ns         56 ns   10000000
BM_IndirectionSort<0, exp_gerbens::QuickSort>         32 ns         32 ns   18300000
BM_IndirectionSort<0, pdqsort_branchless>             40 ns         40 ns   17600000
BM_IndirectionSort<0, HeapSort>                       60 ns         60 ns   11900000

Random pointers sort on value pointed to (1 levels of indirection)

Benchmark                                              Time           CPU Iterations
-------------------------------------------------------------------------------------
BM_IndirectionSort<1, std::sort>                      97 ns         97 ns    7400000
BM_IndirectionSort<1, std::stable_sort>              133 ns        133 ns    5100000
BM_IndirectionSort<1, std_heap_sort>                 180 ns        180 ns    4100000
BM_IndirectionSort<1, andrei::sort>                   67 ns         67 ns   11600000
BM_IndirectionSort<1, exp_gerbens::QuickSort>         42 ns         42 ns   16300000
BM_IndirectionSort<1, pdqsort_branchless>             54 ns         54 ns   10000000
BM_IndirectionSort<1, HeapSort>                      131 ns        131 ns    6000000
Popular Random Projects
Popular Benchmark Projects
Popular Mathematics Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
C Plus Plus
Random
Benchmark
Sort
Bazel