<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Moved the sysouts to the end. &nbsp;Here are some sample runs. &nbsp;The warm up effect may just be environmental. &nbsp;<div><br></div><div>Five runs with no warm up:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">1. &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>137</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>111</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>77</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">2.<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider:<span class="Apple-tab-span" style="white-space:pre">                </span>133</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>93</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>75</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">3.<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>122</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>174</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>73</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">4.<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>109</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>96</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>73</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">5. &nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>134</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>117</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>65</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">Five runs with warm up:</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="font-size: medium;">1.<span class="Apple-tab-span" style="white-space:pre">                </span><span class="Apple-style-span" style="font-family: 'Andale Mono'; font-size: 10px; ">Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>80</span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>109</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>67</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">2.<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>83</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>86</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>82</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">3.<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-style-span" style="color: rgb(255, 31, 25); "><span style="color: #000000">Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>82</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-style-span" style="color: rgb(255, 31, 25); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>87</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>79</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">4.<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>78</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>94</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>63</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; ">5.<span class="Apple-tab-span" style="white-space:pre">        </span>Get Provider: <span class="Apple-tab-span" style="white-space:pre">                </span>83</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Mount Zip: <span class="Apple-tab-span" style="white-space:pre">                </span>86</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><span class="Apple-tab-span" style="white-space:pre">        </span>Determine Packages: <span class="Apple-tab-span" style="white-space:pre">        </span>72</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal 'Andale Mono'; "><br></div></div><div><br><div><div>On Jan 5, 2010, at 2:43 PM, Bill Burke wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>You should move the System.out.println("Mount Zip...") to the end as it <br>will screw up timings.<br><br>BTW, "warming up the JVM" has absolutely no effect on my timings.<br><br>John Bailey wrote:<br><blockquote type="cite">The recursive mounting is really for Zip files nested within Zip files. &nbsp;So in this case there is no need. &nbsp;<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Here is the code I have been testing:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">---<br></blockquote><blockquote type="cite">public class PackageVisitorTestCase extends BaseTestCase<br></blockquote><blockquote type="cite">{<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;public PackageVisitorTestCase(String s)<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;{<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super(s);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> &nbsp;&nbsp;public void testPackageVisitor() throws Exception<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;{<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(1000);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL url = Thread.currentThread().getContextClassLoader().getResource("jacorb.jar");<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TempFileProvider provider = null;<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closeable handle = null;<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;long start = System.currentTimeMillis();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;provider = TempFileProvider.create("test", Executors.newScheduledThreadPool(2));<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Get Provider: " + (System.currentTimeMillis() - start));<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VirtualFile jarFile = VFS.getChild(url);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start = System.currentTimeMillis();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handle = VFS.mountZip(jarFile.getPhysicalFile(), jarFile, provider);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Mount Zip: " + &nbsp;(System.currentTimeMillis() - start));<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VirtualFile[] roots = {jarFile};<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start = System.currentTimeMillis();<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set&lt;String&gt; pkgs = PackageVisitor.determineAllPackages(roots, null, ExportAll.ALL, null, null, null);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Determine Packages: " + &nbsp;(System.currentTimeMillis() - start));<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finally {<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VFSUtils.safeClose(handle, provider);<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br></blockquote><blockquote type="cite"> &nbsp;&nbsp;}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Jan 5, 2010, at 2:24 PM, Bill Burke wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">John Bailey wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I have been running the tests through JProfiler. &nbsp;Not sure if I just have not optimized the profilers settings, but I am getting numbers all over the board, and some are well over double the time of a JUnit execution. &nbsp;The non-profiler time to run the test seems to be &lt;300ms.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">With the profiler enable, I can see ~30% of the total time is in the VFS.mountZip call. &nbsp;With &gt;10% of the total test time taken up by the 5,085 calls to org.jboss.vfs.util.PathTokenizer.getTokens. &nbsp;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">The org.jboss.classloading.plugins.vfs.PackageVisitor.determineAllPackages call is taking ~35% of the total test time to run. &nbsp;With ~14% of the total test time in VirutalFile.isDirectory. <br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Ya, JProfiler is all over the place for me too.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I did currentTimeMillis() timing &nbsp;VFS init took 179/252ms if I don't do <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">children recursive mount. &nbsp;420/456ms if I do do recursive child mount. <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(Maybe children are getting initialized/cached or something with the <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">recursive child mount).<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Maybe there is room for more caching of this isDirectory like calls. &nbsp;There may be a problem with caching the info as the actual file system can change for a given VirutalFile, and the cached information is not guaranteed to remain accurate. &nbsp;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Should be fine to cache for a jar? &nbsp;VirtualFile could ask the FileSystem <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">if its cacheable or not.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Or, even better, you could have parallel non-cached getters that could <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">be used by sensitive logic (like a deploy/ directory scanner). &nbsp;If a <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">non-cached getter detects a new value, it invalidates the entire cache.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">i.e.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Bill<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-- <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Bill Burke<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">JBoss, a division of Red Hat<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://bill.burkecentral.com">http://bill.burkecentral.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">jboss-development mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:jboss-development@lists.jboss.org">jboss-development@lists.jboss.org</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/jboss-development">https://lists.jboss.org/mailman/listinfo/jboss-development</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite"> &nbsp;John Bailey<br></blockquote><blockquote type="cite"> &nbsp;JBoss by Red Hat<br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">jboss-development mailing list<br></blockquote><blockquote type="cite"><a href="mailto:jboss-development@lists.jboss.org">jboss-development@lists.jboss.org</a><br></blockquote><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/jboss-development">https://lists.jboss.org/mailman/listinfo/jboss-development</a><br></blockquote><br>-- <br>Bill Burke<br>JBoss, a division of Red Hat<br><a href="http://bill.burkecentral.com">http://bill.burkecentral.com</a><br>_______________________________________________<br>jboss-development mailing list<br>jboss-development@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/jboss-development<br></div></blockquote></div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>&nbsp;&nbsp;John Bailey</div><div>&nbsp;&nbsp;JBoss by Red Hat</div><div>--</div><div><br></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></body></html>