<div dir="ltr">Hi Jiangli,<div><br></div><div>Thanks for the feedback. I wasn't aware that we optimize for size on MacOSX, so I changed it to Linux-only:</div><div><a href="https://cr.openjdk.java.net/~manc/8220388/webrev.02/">https://cr.openjdk.java.net/~manc/8220388/webrev.02/</a> <div> </div><div>Size and performance comparison was included in <a href="https://bugs.openjdk.java.net/browse/JDK-8220388" target="_blank">https://bugs.openjdk.java.net/browse/JDK-8220388</a>, copying sizes below:<br><div>Sizes of libjvm.so: <br>GoogGcc-default: 25369007 <br>GoogClang-default: 22946876<br>GoogClang-100kInline: 24681265 <br><br>GCC version: 4.9 <br>Clang version: trunk r355087<div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr">-Man</div></div></div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 27, 2019 at 4:57 PM Jiangli Zhou <<a href="mailto:jianglizhou@google.com">jianglizhou@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Man,<br>
<br>
I have a question. Should the -inlinehint-threshold change be applied<br>
to linux only? The following in flags-cflags.m4 indicates it's<br>
optimized for size on MacOSX currently.<br>
<br>
  elif test "x$TOOLCHAIN_TYPE" = xclang; then<br>
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then<br>
      # On MacOSX we optimize for size, something<br>
      # we should do for all platforms?<br>
      C_O_FLAG_HIGHEST_JVM="-Os"<br>
      C_O_FLAG_HIGHEST="-Os"<br>
      C_O_FLAG_HI="-Os"<br>
      C_O_FLAG_NORM="-Os"<br>
      C_O_FLAG_DEBUG_JVM=""<br>
    else<br>
      C_O_FLAG_HIGHEST_JVM="-O3"<br>
      C_O_FLAG_HIGHEST="-O3"<br>
      C_O_FLAG_HI="-O3"<br>
      C_O_FLAG_NORM="-O2"<br>
      C_O_FLAG_DEBUG_JVM="-O0"<br>
    fi<br>
<br>
It would be helpful to share the binary size comparison with gcc and<br>
clang (with -inlinehint-threshold=100000 change).<br>
<br>
Regards,<br>
Jiangli<br>
<br>
<br>
<br>
On Fri, Apr 26, 2019 at 6:38 PM Man Cao <<a href="mailto:manc@google.com" target="_blank">manc@google.com</a>> wrote:<br>
><br>
> (Adding <a href="mailto:build-dev@openjdk.java.net" target="_blank">build-dev@openjdk.java.net</a>)<br>
> Maybe some one from build-dev could review or comment on this change?<br>
><br>
> -Man<br>
><br>
> On Mon, Mar 11, 2019 at 12:55 PM Man Cao <<a href="mailto:manc@google.com" target="_blank">manc@google.com</a>> wrote:<br>
>><br>
>> Thanks for the suggestion.<br>
>> Yes, I agree it makes sense to increase -inlinehint-threshold only for "release" build.<br>
>> However, I'm not sure if adding per-file CXX flags in JvmOverrideFiles.gmk is a better approach.<br>
>> The root problem is that Clang is more likely to ignore the "inline" keyword than GCC, causing unexpected performance problems. G1 pause time could be just one of many potential performance problems.<br>
>> If we take the effort to identify which files need the -inlinehint-threshold flag, we'd better take a step further to identify the functions that should be ALWAYSINLINE.<br>
>><br>
>> Thus I think it is more maintainable to do one the following:<br>
>> (1) Identify the functions that should be "ALWAYSINLINE" instead of "inline", and avoid adding "-inlinehint-threshold" for Clang altogether. This requires much more work.<br>
>> (2) Increase "-inlinehint-threshold" for all files in "release" build for Clang.<br>
>> Note that -inlinehint-threshold is different from -inline-threshold, as -inlinehint-threshold only affects methods marked as "inline" and shouldn't unnecessarily bloat up the binary size for release build.<br>
>><br>
>> So I added an extra guard "x$DEBUG_LEVEL" = xrelease;" in flags-cflags.m4:<br>
>> <a href="https://cr.openjdk.java.net/~manc/8220388/webrev.01/" rel="noreferrer" target="_blank">https://cr.openjdk.java.net/~manc/8220388/webrev.01/</a><br>
>><br>
>> -Man<br>
</blockquote></div>