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 28912 - IndexOverviewAction slows down the 'View' menu invocation
Summary: IndexOverviewAction slows down the 'View' menu invocation
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Javadoc (show other bugs)
Version: -S1S-
Hardware: All All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 27774 34165
  Show dependency tree
 
Reported: 2002-11-21 14:04 UTC by Petr Nejedly
Modified: 2003-02-11 15:29 UTC (History)
1 user (show)

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 Petr Nejedly 2002-11-21 14:04:23 UTC
The IndexOverviewAction's presenter does heavy
computations in its addNotify which causes
slowing the 'View' menu popup significantly.
The computations are in the realms of:
Searching all Javadoc capable FSes for some files,
reading files, parsing HTML files, all of this in
AWT thread during popup menu invocation.
Comment 1 Svata Dedic 2002-12-05 21:16:27 UTC
Do you have any suggestions for collecting the documentation set names  ?
Comment 2 Milan Kubec 2003-01-06 13:10:58 UTC
Version: 4.0 dev -> S1S 4.2
Comment 3 Petr Nejedly 2003-01-07 14:27:49 UTC
I'd say the feature of displaying documentation set names by parsing
files is too costly to be in popup menu.

On the other hand, you can cache the title somewhere, like as an
attribute on the root of the JavaDoc capable FS.
Comment 4 Jesse Glick 2003-01-07 15:03:08 UTC
Probably this would be easier to solve if Actions.SubMenu and
.SubMenuModel behaved a bit more simply w.r.t. when the submenu items
are computed. IOA could simply assume that there are always some index
items to display; if there were some call made to the model such as
addNotify (currently you have to use addNotify on the menu presenter,
I think) then it could compute the list at that time. Two changes in
behavior would need to be made: (1) if there is only one menu item, it
should still display a submenu (which IMHO may be desirable anyway but
my request for this got closed WONTFIX long ago); (2) if there are
none at all, it should display a greyed-out "(none)" item or similar.
Re. change #1, this should probably be optional, since e.g.
PasteAction should display as a simple menu item when there is only
one PasteType, but for many actions it would be better to show a
submenu with one item I think.

Of course it would be possible to give up on using Actions.SubMenu (as
I am often tempted to do anyway) and just write the submenu presenter
manually.

However there is should be an easy partial fix which may be enough:
remove the displayNames list, and move the title parsing logic into
getLabel. addNotify on the menu (e.g. post View menu) will still
search for available index files and show a submenu, single menu item,
or no menu item as appropriate, but it will not do any title parsing
unless you actually post the submenu. Is this enough? Hopefully going
through doc filesystems and checking for index.html is not significant
overhead.
Comment 5 Svata Dedic 2003-02-04 15:13:09 UTC
Done in trunk,

/cvs/javadoc/src/org/netbeans/modules/javadoc/JavadocModule.java,v 
<--  JavadocModule.java
new revision: 1.57; previous revision: 1.56
/cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java,v
done
Checking in src/org/netbeans/modules/javadoc/search/IndexBuilder.java;
/cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java,v
 <--  IndexBuilder.java
initial revision: 1.1
done
Checking in
src/org/netbeans/modules/javadoc/search/IndexOverviewAction.java;
/cvs/javadoc/src/org/netbeans/modules/javadoc/search/IndexOverviewAction.java,v
 <--  IndexOverviewAction.java
new revision: 1.4; previous revision: 1.3
done
Comment 6 Petr Nejedly 2003-02-11 15:29:43 UTC
OK.