-
Bug
-
Resolution: Duplicate
-
P3
-
8, 9, 10, 11
ADDITIONAL SYSTEM INFORMATION :
macOS High Sierra version 10.13.4 with java 10.0.1
A DESCRIPTION OF THE PROBLEM :
On Linux, the first time Toolkit.getImage(URL) is called with a fresh URL, takes only 16ms, while on OS X, it takes 1600ms. On subsequence run and call of the same (probably cached) URL, takes 1ms on Linux, but 300+ms on OS X
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On both linux (I have Fedora 27 with updates) and Mac OS, compile the attached source code. Run the program with "java test.Test" several times (assuming CLASSPATH is set).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The Mac OS version should be just as fast as the Linux version.
ACTUAL -
The Mac OS is 100 times slower than on Linux.
---------- BEGIN SOURCE ----------
package test;
import java.awt.*;
import java.net.*;
public class Test {
public static void main(String[] args) throws Exception {
String s = "https://upload.wikimedia.org/wikipedia/commons/9/95/Big_Pine_landscape.jpg";
URL u = new URL(s);
Toolkit t = Toolkit.getDefaultToolkit();
long b = System.currentTimeMillis();
Image i = t.getImage(u);
System.out.println("got image in " + (System.currentTimeMillis() - b) + "ms");
}
}
---------- END SOURCE ----------
FREQUENCY : always
macOS High Sierra version 10.13.4 with java 10.0.1
A DESCRIPTION OF THE PROBLEM :
On Linux, the first time Toolkit.getImage(URL) is called with a fresh URL, takes only 16ms, while on OS X, it takes 1600ms. On subsequence run and call of the same (probably cached) URL, takes 1ms on Linux, but 300+ms on OS X
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On both linux (I have Fedora 27 with updates) and Mac OS, compile the attached source code. Run the program with "java test.Test" several times (assuming CLASSPATH is set).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The Mac OS version should be just as fast as the Linux version.
ACTUAL -
The Mac OS is 100 times slower than on Linux.
---------- BEGIN SOURCE ----------
package test;
import java.awt.*;
import java.net.*;
public class Test {
public static void main(String[] args) throws Exception {
String s = "https://upload.wikimedia.org/wikipedia/commons/9/95/Big_Pine_landscape.jpg";
URL u = new URL(s);
Toolkit t = Toolkit.getDefaultToolkit();
long b = System.currentTimeMillis();
Image i = t.getImage(u);
System.out.println("got image in " + (System.currentTimeMillis() - b) + "ms");
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8221969 Bug JDK-8202177 still not fixed in JDK-12
-
- Closed
-
-
JDK-8222433 URL.openStream() is an extremely slow
-
- Open
-