[PATCH] D36423: [libc++] Introsort based sorting function

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 20 13:19:22 PDT 2017


hiraditya added a comment.

Results with the patch.

Before:

  Run on (8 X 3900 MHz CPU s)
  2017-08-20 15:11:41
  -------------------------------------------------------------------------------
  Benchmark                                        Time           CPU Iterations
  -------------------------------------------------------------------------------
  BM_Sort/random_uint32/65536               14202353 ns   14203202 ns         48
  BM_Sort/sorted_ascending_uint32/65536       254100 ns     254108 ns       2754
  BM_Sort/sorted_descending_uint32/65536      552118 ns     552151 ns       1232
  BM_Sort/single_element_uint32/65536         170140 ns     170136 ns       4090
  BM_Sort/pipe_organ_uint32/65536            5989117 ns    5989494 ns        113
  BM_Sort/random_strings/65536             105697682 ns  105702553 ns          7
  BM_Sort/sorted_ascending_strings/65536    13324109 ns   13324186 ns         50
  BM_Sort/sorted_descending_strings/65536   19057303 ns   19058005 ns         36
  BM_Sort/single_element_strings/65536      57941433 ns   57944691 ns         12
  BM_Sort/qsort_worst_uint32/65536         694858550 ns  694894213 ns          1

After:

  Run on (8 X 3900 MHz CPU s)
  2017-08-20 15:15:14
  -------------------------------------------------------------------------------
  Benchmark                                        Time           CPU Iterations
  -------------------------------------------------------------------------------
  BM_Sort/random_uint32/65536               14073209 ns   14073732 ns         49
  BM_Sort/sorted_ascending_uint32/65536       257596 ns     257610 ns       2740
  BM_Sort/sorted_descending_uint32/65536      560208 ns     560069 ns       1226
  BM_Sort/single_element_uint32/65536         170543 ns     170549 ns       4075
  BM_Sort/pipe_organ_uint32/65536            6008832 ns    6009173 ns        113
  BM_Sort/random_strings/65536             104672888 ns  104677220 ns          7
  BM_Sort/sorted_ascending_strings/65536    13334016 ns   13334393 ns         54
  BM_Sort/sorted_descending_strings/65536   18883275 ns   18883831 ns         37
  BM_Sort/single_element_strings/65536      57022905 ns   57025206 ns         12
  BM_Sort/qsort_worst_uint32/65536          16870788 ns   16871828 ns         41


https://reviews.llvm.org/D36423





More information about the llvm-commits mailing list