Fw: Patch for File Scanning

mike.skells at talk21.com mike.skells at talk21.com
Sun Oct 9 15:07:13 PDT 2011

Hi All,
I have a few optimisations that I have found in nio2 Path Scanning.
I found these during the scanning phase of the jar improvements that I have been working on

The changes only really affect the first few runs thorough the code, and after the scan of the first 20K files there is not much difference, however this does mean a significant improvement for small utility apps (e.g. jar). Most of the improvement were if the path scanning (removing as string+=string that could be optimised), and changes to the WindowsPathWithAttributes 

A change that I am not sure about is  - there was a WeakReference to the attributes which I have set to final in this patch, but there may be some subtlety that I am missing

The test app scans through the content of rt.jar exploded in windows, and some of the improvements are windows file specific. 

I have not looked at the Unix Path implementation to see if the same improvement scan be made as I have no means to verify or even quantify those changes

the performance comparing the changes in ms for a single VM executing the same scan repeatedly. All files were cached in the system cache prior to tests being run 

 jdk7 patch improvement 
 592 421 41% 
 256 265 -3% 
 204 206 -1% 
 176 172 2% 
 175 167 5% 
 173 169 2% 
 177 177 0% 
 173 167 4%  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20111009/5b142536/attachment-0001.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FileScanning.java
Url: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20111009/5b142536/attachment-0003.ksh 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdk_3852.patch
Type: application/octet-stream
Size: 11488 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20111009/5b142536/attachment-0001.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: JavaApplication2.java
Url: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20111009/5b142536/attachment-0004.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FileCommand.java
Url: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20111009/5b142536/attachment-0005.ksh 

More information about the nio-dev mailing list