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 17056 - VcsSearchType.enabled() is way too slow
Summary: VcsSearchType.enabled() is way too slow
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2001-10-26 20:56 UTC by Jesse Glick
Modified: 2003-07-01 12:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-10-26 20:56:36 UTC
[dev oct 25] This one method took 24.7% (!) of CPU time in my
experiment while I was moving the node selection in the Explorer (with
no VCS filesystems mounted, note). This time was spent in
InstanceSupport.instanceClass. Note that since every Java source has
an InstanceCookie, every time you select a node in the Explorer, a
check is made to see if FindAction should be enabled, which because of
VcsSearchType causes that Java source to be loaded from the current
classloader. This is very time-consuming. Please rewrite this method;
you might consider checking that the node does _not_ have DataObject
as a cookie. Also please use InstanceCookie.Of.instanceOf(), this is
what it is for (unfortunately it will not help on the
InstanceSupport's that JavaDataObject uses, but it is critical on
other nodes such as settings).
Comment 1 Martin Entlicher 2001-10-29 11:17:31 UTC
Fixed by check on DataObject cookie and usage of InstanceCookie.Of
instead of InstanceCookie.
Please verify whether the performance was improved.
Comment 2 Jesse Glick 2001-10-29 12:09:19 UTC
I can check at some point, but the new code looks very weird. Surely
if there is one node selected, Filesystems, its DataObject cookie will
be null and the method will return false? I'm not sure I follow the
logic. Ignore if I am just confused, but I think you meant:

DataFolder folder = ...getCookie(DataFolder);
if (folder != null) {
    // ... as now
} else {
    // move this inside else-clause and reverse it:
    if (...getCookie(DataObject.class) != null) continue;
    InstanceCookie.Of ic = ...;
    // ... as now
}
Comment 3 Martin Entlicher 2001-10-29 13:41:32 UTC
Oh yes, I didn't realize, that DataSystem does not have a DataObject
cookie. Now it makes sense. The change done. Thanks for hints.
Comment 4 Jesse Glick 2001-10-30 21:03:51 UTC
I did some quick timing tests today and saw no mention of vcscore. :-)
Comment 5 Quality Engineering 2003-07-01 12:56:14 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.