RFR: JDK-8246751 Mac OS build settings should use -O3
Claes Redestad
claes.redestad at oracle.com
Mon Jun 8 21:17:27 UTC 2020
Hi!
On 2020-06-08 21:52, Sergey Bylokhov wrote:
> On 6/8/20 10:45 am, Magnus Ihse Bursie wrote:
>> On 2020-06-08 19:31, Sergey Bylokhov wrote:
>>> One of the reasons why -0s was used from the beginning is the
>>> performance of the client related libraries, especially java2d.
>>> Does anybody run or plan to run performance tests to check that we do
>>> not have performance there?
>> As Claes say in the bug report, hopefully any potential performance
>> regression will show up in the general performance testing.
>>
>> The idea here is, after all, that we will *increase* performance. :-)
>
> But how did you know that the performance will increase?
We don't know for sure.
But there are some admittedly limited experiments that backs this up,
but many more benchmarks will be run automatically over the next couple
of weeks to give a more complete verdict.
>
>> Is there some specific library/behavior/test that you are worried
>> about that should show performance regression when we increase the
>> optimization level?
>
> This -0s mode was selected because it shows best or equal performance
> and also provides a less size footprint that affects the client/UI code.
> I guess at least some graphical tests should be checked for possible
> performance regressions, like j2dbench.
j2dbench is part of our performance testing coverage on Mac.
>
> BTW there is similar discussion in the "[macos] bring back O2 opt level
> for unsafe.cpp" on hotspot-dev at .
Not too similar, since that involves a compiler bug that basically
forced applying the -O1 flag to a critical piece of the runtime.
Obviously there needs to be a pragmatic approach when hitting a compiler
bug like the one discussed in that thread, with the goal of removing the
special-case as soon as possible.
/Claes
>
>>
>> /Magnus
>>>
>>> On 6/8/20 8:55 am, Magnus Ihse Bursie wrote:
>>>> From Jim's bug report:
>>>>
>>>> "Mac OS X should use -O3 optimization level to be consistent with
>>>> other platforms and benefit Mac OS X java with the same performance
>>>> levels as other platforms.
>>>>
>>>> Mac OS X has used -Os level optimization since management of the
>>>> platform JDK was handed over from Apple. This level of optimization
>>>> was Apple's policy, not OpenJDK's. The policy was established in a
>>>> time when memory was tight (I was there at the time.) Since then
>>>> other platforms have moved on, making the decision to target speed
>>>> over disk space. Specifically, using -O3 level optimization.
>>>>
>>>> I've personally seen 20-30% improvement in performance in C/C++
>>>> applications using -O3 over -Os. But, of course, the performance
>>>> team should verify the affect on the JDK.
>>>>
>>>> A 11% real time improvement can be seen with a rough HelloWord
>>>> compile/run."
>>>>
>>>> I discussed this with Claes, our performance guru, and he agreed
>>>> that it is low risk enough that we can push this for JDK 15.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8246751
>>>> WebRev:
>>>> http://cr.openjdk.java.net/~ihse/JDK-8246751-macos-optimize-O3/webrev.01
>>>>
>>>>
>>>> /Magnus
>>>
>>>
>>
>
>
More information about the build-dev
mailing list