[libcxx-commits] [PATCH] D151521: [libc++] Optimize transform_reduce for floating point types

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 26 09:17:34 PDT 2023


philnik added a comment.

Benchmarks:

  ------------------------------------------------------
  Benchmark                           old            new
  ------------------------------------------------------
  bm_reduce<float>/1             0.555 ns       0.710 ns
  bm_reduce<float>/2             0.703 ns        1.58 ns
  bm_reduce<float>/3              1.56 ns        1.88 ns
  bm_reduce<float>/4              1.88 ns        2.19 ns
  bm_reduce<float>/5              2.21 ns        2.51 ns
  bm_reduce<float>/6              2.50 ns        2.84 ns
  bm_reduce<float>/7              2.82 ns        3.16 ns
  bm_reduce<float>/8              3.13 ns        3.45 ns
  bm_reduce<float>/16             5.63 ns        1.69 ns
  bm_reduce<float>/64             26.9 ns        2.88 ns
  bm_reduce<float>/512             412 ns        17.9 ns
  bm_reduce<float>/4096           3778 ns         219 ns
  bm_reduce<float>/32768         30722 ns        1913 ns
  bm_reduce<float>/262144       246213 ns       15445 ns
  bm_reduce<float>/1048576      994918 ns       62948 ns
  
  ----------------------------------------------------------------
  Benchmark                                    old             new
  ----------------------------------------------------------------
  bm_transform_reduce<float>/1            0.863 ns        0.872 ns
  bm_transform_reduce<float>/2             1.57 ns         1.58 ns
  bm_transform_reduce<float>/3             1.88 ns         1.92 ns
  bm_transform_reduce<float>/4             2.19 ns         2.23 ns
  bm_transform_reduce<float>/5             2.50 ns         2.51 ns
  bm_transform_reduce<float>/6             2.83 ns         2.82 ns
  bm_transform_reduce<float>/7             3.13 ns         3.14 ns
  bm_transform_reduce<float>/8             3.44 ns         3.46 ns
  bm_transform_reduce<float>/16            3.23 ns         2.24 ns
  bm_transform_reduce<float>/64            19.6 ns         4.56 ns
  bm_transform_reduce<float>/512            356 ns         30.3 ns
  bm_transform_reduce<float>/4096          3720 ns          241 ns
  bm_transform_reduce<float>/32768        31159 ns         3177 ns
  bm_transform_reduce<float>/262144      246021 ns        25263 ns
  bm_transform_reduce<float>/1048576    1069957 ns       111642 ns


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151521



More information about the libcxx-commits mailing list