-
Enhancement
-
Resolution: Duplicate
-
P5
-
None
-
1.3.0
-
None
-
generic
-
solaris_7
Running "truss" on a trivial AWT program shows that the system font directory
files such as /usr/openwin/lib/X11/fonts/Type1/fonts.dir and /usr/openwin/lib/locale/iso_8859_*/X11/fonts/TrueType/fonts.dir are
read using a system call per byte. This is most likely due to the use of
a FileInputStream or other unbuffered interface in Java. This
results in an unnecessary increase in application startup time and is
easily fixed by using a BufferedInputStream.
The program is as follows:
import java.awt.Frame;
public class InitBug {
public static void main(String[] args) {
Frame f = new Frame("InitBug");
f.pack();
f.setVisible(true);
}
}
A short excerpt from the truss output:
access("/usr/openwin/lib/X11/fonts/Type1/fonts.dir", 4) = 0
open("/usr/openwin/lib/X11/fonts/Type1/fonts.dir", O_RDONLY|O_LARGEFILE) = 21
fstat(21, 0xFFBECB80) = 0
fcntl(21, F_GETFL, 0x00000000) = 8192
fstat64(21, 0xFFBEC8E0) = 0
fstat64(21, 0xFFBEC948) = 0
fcntl(21, F_SETFL, 0x00002080) = 0
ioctl(21, I_SETSIG, S_INPUT|S_HIPRI|S_OUTPUT|S_HANGUP) Err#25 ENOTTY
sigprocmask(SIG_BLOCK, 0xFFBECA40, 0xFFBECA30) = 0
sigprocmask(SIG_SETMASK, 0xFFBECA30, 0x00000000) = 0
read(21, " 1", 1) = 1
read(21, " 7", 1) = 1
read(21, "\n", 1) = 1
read(21, " U", 1) = 1
read(21, " T", 1) = 1
read(21, " R", 1) = 1
read(21, " G", 1) = 1
read(21, " _", 1) = 1
read(21, " _", 1) = 1
read(21, " _", 1) = 1
read(21, " _", 1) = 1
read(21, " .", 1) = 1
read(21, " p", 1) = 1
read(21, " f", 1) = 1
...
files such as /usr/openwin/lib/X11/fonts/Type1/fonts.dir and /usr/openwin/lib/locale/iso_8859_*/X11/fonts/TrueType/fonts.dir are
read using a system call per byte. This is most likely due to the use of
a FileInputStream or other unbuffered interface in Java. This
results in an unnecessary increase in application startup time and is
easily fixed by using a BufferedInputStream.
The program is as follows:
import java.awt.Frame;
public class InitBug {
public static void main(String[] args) {
Frame f = new Frame("InitBug");
f.pack();
f.setVisible(true);
}
}
A short excerpt from the truss output:
access("/usr/openwin/lib/X11/fonts/Type1/fonts.dir", 4) = 0
open("/usr/openwin/lib/X11/fonts/Type1/fonts.dir", O_RDONLY|O_LARGEFILE) = 21
fstat(21, 0xFFBECB80) = 0
fcntl(21, F_GETFL, 0x00000000) = 8192
fstat64(21, 0xFFBEC8E0) = 0
fstat64(21, 0xFFBEC948) = 0
fcntl(21, F_SETFL, 0x00002080) = 0
ioctl(21, I_SETSIG, S_INPUT|S_HIPRI|S_OUTPUT|S_HANGUP) Err#25 ENOTTY
sigprocmask(SIG_BLOCK, 0xFFBECA40, 0xFFBECA30) = 0
sigprocmask(SIG_SETMASK, 0xFFBECA30, 0x00000000) = 0
read(21, " 1", 1) = 1
read(21, " 7", 1) = 1
read(21, "\n", 1) = 1
read(21, " U", 1) = 1
read(21, " T", 1) = 1
read(21, " R", 1) = 1
read(21, " G", 1) = 1
read(21, " _", 1) = 1
read(21, " _", 1) = 1
read(21, " _", 1) = 1
read(21, " _", 1) = 1
read(21, " .", 1) = 1
read(21, " p", 1) = 1
read(21, " f", 1) = 1
...
- duplicates
-
JDK-4202846 Solaris Font code is inefficient
-
- Resolved
-