[OpenJDK 2D-Dev] RFR: 8251854 [macosx] Java forces the use of discrete GPU

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Aug 25 06:27:25 UTC 2020


On 24.08.2020 13:35, Philip Race wrote:
> 
> Is there any performance cost to doing this ? I'd expect so. Any estimate ?

Yes, performance is affected for sure:

  - SwingMark:
    OGL_Base: 14000
    OGL_Fix: 24000
    Metal: 18000

  - Here is a j2dbench for the common draw operations(new/old/metal):
    http://cr.openjdk.java.net/~serb/8251854/perf/results.txt

   Summary:
   OGL_base:
     Number of tests:  24
     Overall average:  4.556306150323041E8
     Best spread:      0.16% variance
     Worst spread:     4.68% variance
     (Basis for results comparison)

   OGL_fix:
     Number of tests:  24
     Overall average:  1.0086929824044746E8
     Best spread:      0.04% variance
     Worst spread:     7.89% variance
     Comparison to basis:
       Best result:      83.41% of basis
       Worst result:     15.73% of basis
       Number of wins:   0
       Number of ties:   0
       Number of losses: 24

   metal:
     Number of tests:  24
     Overall average:  8.841681616575797E7
     Best spread:      0.08% variance
     Worst spread:     5.64% variance
     Comparison to basis:
       Best result:      248.11% of basis
       Worst result:     19.1% of basis
       Number of wins:   8
       Number of ties:   2
       Number of losses: 14
==========================================

  - Here is a j2dbench for the common draw operations(newOGL vs metal only):
    http://cr.openjdk.java.net/~serb/8251854/perf/newOGL_vs_Metal.txt
   
   Summary:
   OGL_fix:
     Number of tests:  24
     Overall average:  2.5871177969681844E7
     Best spread:      0.04% variance
     Worst spread:     7.01% variance
     (Basis for results comparison)

   metal:
     Number of tests:  24
     Overall average:  2.1896134898150157E7
     Best spread:      0.04% variance
     Worst spread:     1.98% variance
     Comparison to basis:
       Best result:      488.31% of basis
       Worst result:     30.77% of basis
       Number of wins:   14
       Number of ties:   0
       Number of losses: 10
  
> And there's then no way to explicitly request the discrete card on a 15/16" MBP.

   I have checked that the discrete card is enabled by the macOS:
   - if the full screen window is set
   - if the second monitor is connected
   Do not know any other ways to enable it.


> Should we release note this ?

Yes, I think so.
Note that it does not affect the bundled applications only apps running via java launcher.
But some(most?) bundled java applications use this flag already.


-- 
Best regards, Sergey.



More information about the build-dev mailing list