Slow readng tzdb.dat
Xueming Shen
xueming.shen at oracle.com
Wed Oct 9 10:50:21 PDT 2013
Hi Salter,
Thanks for the report and suggested fix, I have filed a bug for this issue.
Yes, it probably will trigger a slow loading if run on a "high-latency" remote
file system. There was a BufferredInputstram wrapper at the beginning,
then I guess it got dropped during performance measure/testing, on local
local file system. Will get it fixed.
https://bugs.openjdk.java.net/browse/JDK-8026197
thanks!
-Sherman
On 10/09/2013 10:08 AM, Salter, Thomas A wrote:
> I noticed recently that the JDK8 JVM was very slow starting on systems where the JRE is on a high-latency, remote file system. I tracked this down to the reading of tzdb.dat. In java/time/zone/TzdbZoneRulesProvider.java and sun/util/calendar/ZoneInfoFile.java the tzdb.dat file is read using a DataInputStream directly over a FileInputStream. Consequently there ends up being a large number of very small (often a single byte) read requests to the underlying O/S file system. This can be fixed trivially by adding a BufferedInputStream between the DataInputStream and the FileInputStream.
>
> Thus this:
> try (DataInputStream dis = new DataInputStream(
> new FileInputStream(new File(libDir, "tzdb.dat")))) {
> becomes:
> try (DataInputStream dis = new DataInputStream(
> new BufferedInputStream(
> new FileInputStream(new File(libDir, "tzdb.dat")), 32000))) {
>
More information about the jdk8-dev
mailing list