-
Bug
-
Resolution: Duplicate
-
P3
-
9, 11, 12
ADDITIONAL SYSTEM INFORMATION :
same result on different hardware and Windows 7
A DESCRIPTION OF THE PROBLEM :
paint works fine for versions up to 1.8.0_192 but degrades on recent versions e.g. 11.0.1.
paint method take 60(!) times longer to complete.
REGRESSION : Last worked in version 8u192
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile and run using jdk1.8.0_192
(compile and ) run using jdk-11.0.1
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
similar performance for jdk1.8.0_192 and jdk-11.0.1
ACTUAL -
jdk-11.0.1 takes 60 times longer than jdk1.8.0_192
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
class GraphicsPaintPerformance extends Frame // javax.swing.JFrame
{
int [] x = null;
int [] y = null;
public static void main( String [] args )
{
new GraphicsPaintPerformance();
}
GraphicsPaintPerformance()
{
int N = 20000;
x = new int[N];
y = new int[N];
for( int i = 0; i < N; i++ )
{
x[i] = (int)( 500 * Math.random() + 50 );
y[i] = (int)( 500 * Math.random() + 80 );
}
setSize( 600, 630 );
setVisible( true );
addWindowListener( new WindowAdapter()
{
public void windowClosing( WindowEvent we )
{
System.exit(0);
}
});
}
public void paint( Graphics g )
{
long start = System.currentTimeMillis();
int n = x.length;
for( int i = 1; i < n; i++ )
{
g.drawLine( x[i-1], y[i-1], x[i], y[i] );
}
g.setColor( Color.WHITE );
g.fillRect( 250, 280, 100, 100 );
g.setColor( Color.BLACK );
g.drawString( 0.001 * ( System.currentTimeMillis() - start ) + " s", 280, 335 );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
stay with jdk1.8.0_192
FREQUENCY : always
same result on different hardware and Windows 7
A DESCRIPTION OF THE PROBLEM :
paint works fine for versions up to 1.8.0_192 but degrades on recent versions e.g. 11.0.1.
paint method take 60(!) times longer to complete.
REGRESSION : Last worked in version 8u192
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
compile and run using jdk1.8.0_192
(compile and ) run using jdk-11.0.1
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
similar performance for jdk1.8.0_192 and jdk-11.0.1
ACTUAL -
jdk-11.0.1 takes 60 times longer than jdk1.8.0_192
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
class GraphicsPaintPerformance extends Frame // javax.swing.JFrame
{
int [] x = null;
int [] y = null;
public static void main( String [] args )
{
new GraphicsPaintPerformance();
}
GraphicsPaintPerformance()
{
int N = 20000;
x = new int[N];
y = new int[N];
for( int i = 0; i < N; i++ )
{
x[i] = (int)( 500 * Math.random() + 50 );
y[i] = (int)( 500 * Math.random() + 80 );
}
setSize( 600, 630 );
setVisible( true );
addWindowListener( new WindowAdapter()
{
public void windowClosing( WindowEvent we )
{
System.exit(0);
}
});
}
public void paint( Graphics g )
{
long start = System.currentTimeMillis();
int n = x.length;
for( int i = 1; i < n; i++ )
{
g.drawLine( x[i-1], y[i-1], x[i], y[i] );
}
g.setColor( Color.WHITE );
g.fillRect( 250, 280, 100, 100 );
g.setColor( Color.BLACK );
g.drawString( 0.001 * ( System.currentTimeMillis() - start ) + " s", 280, 335 );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
stay with jdk1.8.0_192
FREQUENCY : always
- duplicates
-
JDK-8212124 Reduced performance of java.awt.Graphics2D.drawPolyline
- Open
- relates to
-
JDK-8212124 Reduced performance of java.awt.Graphics2D.drawPolyline
- Open