RFR: 8210416: [linux] Poor StrictMath performance due to non-optimized compilation

Gustavo Romero gromero at linux.vnet.ibm.com
Wed Sep 12 03:51:08 UTC 2018


Hi Severin,

On 09/11/2018 09:02 AM, Severin Gehwolf wrote:
> Micro-benchmark results from running [1] for x86_64 and ppc64le are
> here (-O2 is sufficient it seems):
> 
> http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8210416/microbenchmarks_results/
> 
> More thoughts?

Thanks a lot for checking it on PPC64.

I did additional tests on a POWER8 using the same microbench. I share the
results below. The numbers are the arithmetic mean of 10 runs. Unit is second.

   1 O3                                   |  O2
   2          Math            StrictMath  |           Math            StrictMath
   3                                      |
   4 acos:    3.0728          3.0728      |  acos:    3.07325         3.07375
   5 asin:    3.0933          3.0916      |  asin:    3.09337         3.0915
   6 atan2:   10.9743         10.9759     |  atan2:   11.2994         11.2977
   7 atan:    7.653           7.6602      |  atan:    7.48463         7.48225
   8 cbrt:    13.444          13.4433     |  cbrt:    13.4535         13.4527
   9 cos:     30.1561         33.9689     |  cos:     30.157          35.1162
  10 cosh:    3.0911          3.1074      |  cosh:    3.09975         3.09088
  11 exp:     1.413           3.0572      |  exp:     1.41313         3.09737
  12 expm1:   3.0281          3.0349      |  expm1:   2.98813         2.98913
  13 hypot:   33.7668         33.7471     |  hypot:   27.9664         27.9675
  14 log10:   4.2213          10.0832     |  log10:   4.221           10.1109
  15 log1p:   9.2886          9.2888      |  log1p:   9.08713         9.08075
  16 log:     3.1362          7.6327      |  log:     3.136           7.633
  17 pow:     13.7787         17.4739     |  pow:     13.7829         17.483
  18 sin:     30.216          33.9733     |  sin:     30.2163         35.1684
  19 sinh:    3.1478          3.152       |  sinh:    3.18638         3.18375
  20 sqrt:    0.665           0.6714      |  sqrt:    0.665           0.671
  21 tan:     31.6409         36.461      |  tan:     31.6385         37.7166
  22 tanh:    3.0753          3.0925      |  tanh:    3.11088         3.10675


Based upon that, it looks like that O3 is better for most of the functions,
specially for sin, cos, and tan.

On the other hand, it looks like that O3 hurts hypot.

Thus it seems -O2 is not quite the same as -O3, but it's not straightforward
to decide which one is better too.

Maybe Andrew can enlight us.

I also CC:ed ppc-aix-port in case somebody there wishes to comment on that.

Thank you.


Best regards,
Gustavo

> Thanks,
> Severin
> 
> [1] https://github.com/gromero/strictmath/
> 



More information about the ppc-aix-port-dev mailing list