Hi Sergey,

Please don't use "union" to build up a region. There are methods for building regions that are very efficient and the "union" operation is meant to be used for occasional operations on 2 already established regions, not for repeated iterative operations in building up a single region from scratch.

Pass the list of spans to a method on Region and have it build the object up in a single pass like any of the existing getScaled, getTranslated, or getInstance(Shape) methods...

                        ...jim

On 11/10/14 12:03 PM, Sergey Bylokhov wrote:
Hello.
Please review the fix for jdk 9:
  - If interaction of dst&clip is empty we return immediately, without
creation of intermediate buffers
  - Size of intermediate buffers now take into account the clip, this is
especially effective if the we have a big scale, which much bigger than
destination
  - One regular blit is used instead of scanline by scanline copying.
Note that I plan to improve generation of the clip region of this method
later.

Bug: https://bugs.openjdk.java.net/browse/JDK-8059942
Webrev can be found at: http://cr.openjdk.java.net/~serb/8059942/webrev.14

Benchmarks, note that the spread is a big(+-50% on each rerun) , because
we generate a lot of garbage(non cached intermediate buffers):
=======================================================================
Windows 7 x64, lenovo T410, nvidia NVS 3100M

D3D:
http://cr.openjdk.java.net/~serb/8059942/ogl_nvidia_win_fix14/results_d3d.txt

     Comparison to basis:
       Best result:      24719.07% of basis
       Worst result:     63.97% of basis
       Number of wins:   78
       Number of ties:   52
       Number of losses: 14

OGL:
http://cr.openjdk.java.net/~serb/8059942/ogl_nvidia_win_fix14/results_ogl.txt

     Comparison to basis:
       Best result:      7797.69% of basis
       Worst result:     91.25% of basis
       Number of wins:   85
       Number of ties:   47
       Number of losses: 12

GDI:
http://cr.openjdk.java.net/~serb/8059942/ogl_nvidia_win_fix14/results_gdi.txt

     Comparison to basis:
       Best result:      106.21% of basis
       Worst result:     81.05% of basis
       Number of wins:   32
       Number of ties:   97
       Number of losses: 15

=======================================================================
OSX 10.9.5, macbook pro retina, nvidia GeForce GT 650M 1024 MB
http://cr.openjdk.java.net/~serb/8059942/ogl_nvidia_osx_fix14/results.txt
     Comparison to basis:
       Best result:      26838.34% of basis
       Worst result:     87.3% of basis
       Number of wins:   78
       Number of ties:   62
       Number of losses: 4

=======================================================================
OSX 10.9.5, macbook pro retina, Intel HD Graphics 4000
http://cr.openjdk.java.net/~serb/8059942/ogl_intel_osx_fix14/results.txt
     Comparison to basis:
       Best result:      20700.43% of basis
       Worst result:     96.94% of basis
       Number of wins:   85
       Number of ties:   57
       Number of losses: 2

Reply via email to