David M. Lloyd wrote:
On 01/05/2010 12:27 PM, Bill Burke wrote:
>
> David M. Lloyd wrote:
>> Anyway this has all been covered, benchmarked, and fixed by VFS3.
>>
> Well....not really.
>
> 446ms now for the PackageTest.
>
> 65% is still VFS initialization.
Using VFS3? If so, can you post details?
Gonna help John Bailey get up to running JProfiler. That cool?
Preliminary, it looks like a lot of things aren't getting cached
(isDirectory, lastModified, isFile, children, etc..). This results in a
lot of hash lookups. Looks like they aren't getting cached because of
mounting?? Not sure.
But, I found a problem with my initialization code (see below). It was
trying to mount children. I commented out that part and it ran in
251ms. 40% in VFS init if profile CPU time, 60% in actual time.
Sometimes jprofiler is weird.
public List<Closeable> recursiveMount(VirtualFile file) throws
IOException
{
ArrayList<Closeable> mounts = new ArrayList<Closeable>();
if (!file.isDirectory() &&
file.getName().matches("^.*\\.([EeWwJj][Aa][Rr]|[Zz][Ii][Pp])$"))
mounts.add(VFS.mountZip(file, file, provider));
/****** Doubled speedup when this was commented out!!!!!!!!!!!!
if (file.isDirectory())
for (VirtualFile child : file.getChildren())
mounts.addAll(recursiveMount(child));
*/
return mounts;
}
private TempFileProvider provider;
protected void setUp() throws Exception
{
super.setUp();
provider = TempFileProvider.create("test", new
ScheduledThreadPoolExecutor(2));
}
protected void tearDown() throws Exception
{
provider.close();
}
Bill
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com