<div dir="ltr">I posted this message first on Java Discuss and was asked to file a Java bug. It was also suggested I post it here for discussion.<br><br>I've recently started using Java 11 and noticed that drawPolyline is<br>much slower on my PC than it was on Java 8.<br>Example, simplified code:<br>Â Â Â @Override<br>Â Â Â protected void paintComponent(Graphics g) {<br>Â Â Â Â Â Â Â super.paintComponent(g);<br>Â Â Â Â Â Â Â Graphics2D graphics = (Graphics2D) g;<br>Â Â Â Â Â Â Â long starttime = System.nanoTime();<br>Â Â Â Â Â Â Â graphics.drawPolyline(xs, ys, xs.length);<br>Â Â Â Â Â Â Â long endtime = System.nanoTime();<br>Â Â Â Â Â Â Â Logger.getLogger(this.getClass().getName()).log(Level.INFO,<br>"Paint Time: {0}s", (double)(endtime-starttime) / 1.0e9);<br>Â Â Â }<br>where xs[] and ys[] are large (65536 points) integer arrays. On Java 8 I get a paint time of 0.025s and on Java 11 it is 25s, i.e. factor of 1000.<br><br>This may be related to JEP263 (HiDPI)<br><br>I've got a recent Core i7 processor with Intel graphics, running Windows 10.<br><br>With VisualVM I can see that all the time goes in drawPolyline, I can't get any more detail than that.<br><br>I have done some experimentation with RenderingHints but nothing makes the JDK11 go as fast as JDK8. <br><br>Is there anything else I can try to either improve matters or to provide a clearer idea of why there is such a difference?<br><br>I have a self-contained NetBeans project if anyone wants to try to see they can reproduce this.<br><a href="https://github.com/pedro-w/PolylineTest.git">https://github.com/pedro-w/PolylineTest.git</a><br><br>Thanks,<br>Peter<br><br><br>Versions:<br>openjdk version "11" 2018-09-25<br>OpenJDK Runtime Environment 18.9 (build 11+28)<br>OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)<br><br>openjdk version "1.8.0-adoptopenjdk"<br>OpenJDK Runtime Environment (build 1.8.0-adoptopenjdk-_2018_05_19_00_59-b00)<br>OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)<br><br></div>