Any major performance change with I/O from JDK 6 that one should be aware of?
Alan Bateman
Alan.Bateman at oracle.com
Sun May 13 11:22:20 PDT 2012
On 13/05/2012 17:35, Fabrizio Giudici wrote:
> I've just succesfully ported to OpenJDK 7 a small desktop application
> that was previously running with Apple's JDK 6. The application
> computes at the maximum speed possible the MD5 fingerprints of files
> in a directory. The performance with Apple JDK 6 is about 95-100
> MB/sec (which is reasonably limited by my disk native I/O speed). The
> same application with OpenJDK 7 runs under 7 MB/sec.
>
> Loading is done by means of MappedByteBuffer:
>
> final @Cleanup RandomAccessFile randomAccessFile = new
> RandomAccessFile(file, "r");
> final MappedByteBuffer byteBuffer =
> randomAccessFile.getChannel().map(READ_ONLY, 0, file.length());
> byteBuffer.load();
> randomAccessFile.close();
>
> From preliminary measurement, the bottleneck is with I/O. In fact,
> with JDK 6 the application takes most of the CPU (MD5 is computed in
> parallel to I/O), while with OpenJDK 7 the CPU is much lower.
>
> Of course I've tested the same application bits side by side with
> Apple JDK 6 and OpenJDK 7 on the same set of files.
>
The above is essentially open + mmap + madvise and there hasn't been
anything of significant between 6 and 7 that comes to mind, unless of
course Apple's jdk6 specifies different advice that improves this case.
The only thing that comes to mind is the security provider, maybe there
is a different MD5 implementation that is being used.
-Alan.
More information about the macosx-port-dev
mailing list