This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 39295 - Poor performance of JavaDataNode.checkUpToDate
Summary: Poor performance of JavaDataNode.checkUpToDate
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-01-28 12:04 UTC by _ tboudreau
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Naive patch to use the fast up-to-date check if a system property is set (1.47 KB, patch)
2004-01-28 12:05 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2004-01-28 12:04:49 UTC
JavaDataNode.checkUpToDate spawns a compiler job and 
does an awful lot of work just to decide if the icon should 
be badged or not (there's even a comment "very slow!!" in 
the method).

The common case in NetBeans is that the user does not set 
the compiler output dir.  So a very fast test on a class file is 
all that is needed in 99% of the use cases.

I'm attaching a simple patch that does this faster test if a 
system property is set.  It makes a noticable difference in 
the performance of opening folders.  It's naively written but 
works (FWIW, I think the performance problem is not so 
much that the slower test is so slow, but the gc's it causes).

What would cover all the cases better:
 - Check the output dir of the compiler type - if not set, use 
the fast test
 - Even faster, some static property of JavaCompilerType 
which returns true if there are no compilers in the system 
with a different output dir; if so, you don't even need to test 
the output dir of the current compiler.


Also, probably a bug in explorer asking for icons it doesn't 
need - the up-to-date test really should never run unless 
the file is actually somehow displayed.
Comment 1 _ tboudreau 2004-01-28 12:05:32 UTC
Created attachment 13113 [details]
Naive patch to use the fast up-to-date check if a system property is set
Comment 2 Jan Pokorsky 2004-03-09 18:01:07 UTC
Makes sense. Even though it is not cheap to find out all compilers and
ask them for the output dir.

Cc Tomas to take this into account for stavbicka
Comment 3 _ tboudreau 2004-03-09 18:05:59 UTC
> Even though it is not cheap to find out all compilers and
> ask them for the output dir.

Shouldn't it be possible to do that check once per run of NetBeans unless something 
actually changes?   
Comment 4 Jan Pokorsky 2004-03-09 18:51:09 UTC
Sure, it should.

But I looked at current apis and I am not aware of any that allows to
find out destination folder of the compiler type. So it is possible
just for java compiler types. In case of eg ant script compiler it
will not work.

Comment 5 _ tboudreau 2004-03-09 21:01:43 UTC
Well, stavbicka is a great opportunity to improve the APIs.  Any case where separation of 
concerns results in information resolution loss (which is what this is) is probably 
something that should be revisited.  
Comment 6 Martin Matula 2004-07-19 16:04:23 UTC
This issue is no longer relevant since the code was completely rewritten.