[PATCH] D53994: Fixing lower bound regression in certain situations.

Denis Yaroshevskiy via Phabricator reviews at reviews.llvm.org
Sun Dec 9 08:24:32 PST 2018


dyaroshev updated this revision to Diff 177433.
dyaroshev added a comment.

Recreated the benchmarks in spirit of the sorting benchmarks.

Seems like a bit more results than we actually need but maybe it's OK.

Haven't tried to do not found elements - fairly confident that it doesn't matter since we never check for equality.

Measurement results (for lower bound)
1048576 on the previous version seems to trigger Google benchmark bug. It happens. (On equal_range doesn't reproduce).

  -----------------------------------------------------------------------------------------------
                                                                   Before             After
  -----------------------------------------------------------------------------------------------
  PartitionPointBench_LowerBoundAlg_TestInt32/256                  144 ns            62 ns    
  PartitionPointBench_LowerBoundAlg_TestInt32/1024                 193 ns            77 ns    
  PartitionPointBench_LowerBoundAlg_TestInt32/1048576              1352 ns          186 ns    
                                                                                              
  PartitionPointBench_LowerBoundAlg_TestInt64/256                   143 ns           63 ns    
  PartitionPointBench_LowerBoundAlg_TestInt64/1024                  205 ns           77 ns    
  PartitionPointBench_LowerBoundAlg_TestInt64/1048576              1440 ns          197 ns    
                                                                                              
  PartitionPointBench_LowerBoundAlg_TestUint32/256                  149 ns           63 ns    
  PartitionPointBench_LowerBoundAlg_TestUint32/1024                 203 ns           93 ns    
  PartitionPointBench_LowerBoundAlg_TestUint32/1048576             1418 ns          186 ns    
                                                                                              
  PartitionPointBench_LowerBoundAlg_TestMediumString/256            395 ns          407 ns    
  PartitionPointBench_LowerBoundAlg_TestMediumString/1024           498 ns          519 ns    
  PartitionPointBench_LowerBoundAlg_TestMediumString/1048576       1370 ns         1286 ns    
  -----------------------------------------------------------------------------------------------


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53994/new/

https://reviews.llvm.org/D53994

Files:
  benchmarks/algorithms.bench.cpp
  benchmarks/algorithms.partition_point.bench.cpp
  benchmarks/algorithms.sorting.bench.cpp
  include/algorithm
  test/libcxx/algorithms/half_positive.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53994.177433.patch
Type: text/x-patch
Size: 7603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181209/3d3528c0/attachment.bin>


More information about the libcxx-commits mailing list