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 65364 - J2SE Project node popup in Projects view is slow
Summary: J2SE Project node popup in Projects view is slow
Status: CLOSED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Performance (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords: PERFORMANCE, REGRESSION
Depends on:
Blocks:
 
Reported: 2005-09-29 15:42 UTC by Antonin Nebuzelsky
Modified: 2011-05-25 11:37 UTC (History)
2 users (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 Antonin Nebuzelsky 2005-09-29 15:42:46 UTC
Our performance tests show that popup on J2SE project node is shown too slowly.

   JSE Project node popup in Projects View
   [ ms ] / 100 ms 	FC3 	JDS3 	Sol9 	Sol10 	W2K
 1st invocation 	562 	580 	234 	395 	156
Comment 1 Tomas Zezula 2005-10-03 11:05:01 UTC
Is there a measurement for NetBeans 4.1 to find out how it has changed?
Comment 2 Antonin Nebuzelsky 2005-10-03 11:26:42 UTC
Yes, I found results we have measured for NB41 (build 200505031930).

  Project node popup in Projects View
   [ ms ] / 100 ms 	FC3 	JDS3 	Sol9 	Sol10 	W2K 	WinXP
 	1st usage 	94 	N/A 	196 	132 	78 	88
Comment 3 Tomas Zezula 2005-10-03 15:05:48 UTC
It's caused by Petr's commit:
User: pkuzel  
Date: 05/05/05 06:42:24

Modified:
 /java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/
  J2SEPhysicalViewProvider.java

Log:
 #57874 contract honored - Actions on project node.

File Changes:

Directory: /java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/
Comment 4 _ pkuzel 2005-10-03 15:21:54 UTC
The change is rather trivial:

                FileObject fo =
Repository.getDefault().getDefaultFileSystem().findResource("Projects/Actions");
// NOI18N
                if (fo != null) {
                    DataObject dobj = DataObject.find(fo);
                    FolderLookup actionRegistry = new
FolderLookup((DataFolder)dobj);
                    Lookup.Template query = new Lookup.Template(Object.class);
                    Lookup lookup = actionRegistry.getLookup();
                    Iterator it = lookup.lookup(query).allInstances().iterator();
                    if (it.hasNext()) {
                        actions.add(null);
                    }
                    while (it.hasNext()) {
                        Object next = it.next();
                        if (next instanceof Action) {
                            actions.add(next);
                        } else if (next instanceof JSeparator) {
                            actions.add(null);
                        }
                    }
                }

and follows DataLoader mime based action pool pattern.

Could you profile this (anti)pattern?
Comment 5 _ pkuzel 2005-10-03 15:22:51 UTC
BTW it scattered all around code base in all project types.
Comment 6 _ pkuzel 2005-10-03 15:59:55 UTC
XML fs merging on first read is quite slow....
Comment 7 _ rkubacki 2005-10-04 14:19:42 UTC
> XML fs merging on first read is quite slow....

Have you seen this in profiler? The merge is done during first start and later
BinaryFS that is already merged is used (assuming the cache is from previous rn
is valid).
Comment 8 Antonin Nebuzelsky 2005-10-11 11:56:10 UTC
There is no need to do the full actionRegistry pattern in the popup invocation.
You can initialize your actionRegistry at project opening which takes long
anyway and is(will be) covered with progress indication.
Comment 9 _ pkuzel 2005-10-12 16:36:15 UTC
Interesting idea. Reminding that the same pattern is used in all project types. 
Comment 10 Tomas Zezula 2005-10-12 17:59:08 UTC
Reassigning to javacvs since it is a javacvs code even it is hosted under the
java/j2seproject.
Comment 11 _ pkuzel 2005-10-20 15:29:03 UTC
Returning... No, it's generic project contract that all project type impls must
follow. Profiler also injects some actions AFAIK.

Droping priority: user impact is very limited (on contemporary hardware).
Comment 12 Antonin Nebuzelsky 2005-10-21 10:49:15 UTC
> Droping priority: user impact is very limited (on contemporary hardware).

P3 enhancement? Good joke. :-)))

However, your HW configuration is irrelevant. Officially recommended supported
configuration is what matters (see Release Notes). And UI limits (100ms in this
case).
Comment 13 Tomas Zezula 2005-10-24 16:28:48 UTC
It is javacvs code even it is commited into every project type, this is even
worse, it slowed down all project types. The javacvs module is the only one who
can solve it, eg. by preinitialization of the CVS menu in the warm up task.
Otherwise each project type will need to schedule the same warm up task doing
the same preinitialization of the CVS menu, which will be slow.
Comment 14 _ pkuzel 2005-10-24 17:52:52 UTC
Three players here: project type impls, CVS module and infrastructure.

Sorry Tomas for not accepting, but as Tonda suggested it could be sampled during
opening project. Warm up tasks are evil and should be avoided if here exists
progress covered hook triggered by related user action. It must be done in all
project type implementations, piece by piece. Therefore I do not think it's wise
to blame project type impls :-).

At CVS side I have implemented asynchronous sub-menu construction - loading CVS
SystemActions in RP:

Checking in ProjectCvsMenuItem.java;
/shared/data/ccvs/repository/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/ProjectCvsMenuItem.java,v
 <--  ProjectCvsMenuItem.java
new revision: 1.10; previous revision: 1.9
done

Remaining player is infrastructure - its scalability. It's pity that SFS and
Lookup infrastructure seems to be slow to hit 100ms constraint. The registration
format follows standard suggested pattern (copied from DataLoader MIME based
action extensions).

Tonda, could you push on speeding up the infrastructure, please? Note there is
registered only one instance (2 with optional profiler) and suggested code
template uses FolderLookup that narrows searched context to exact SFS folder. 

I hope it's last time I see this issue assigned to javacvs component.
Comment 15 Jan Lahoda 2005-10-25 09:37:51 UTC
*** Issue 67450 has been marked as a duplicate of this issue. ***
Comment 16 Antonin Nebuzelsky 2005-11-29 13:51:23 UTC
The measured times are now slightly over the expected numbers (200ms for 1st,
100ms for next):

   JSE Project node popup in Projects View
   [ ms ] / 100 ms	FC3	Sol9	Sol10	W2K	WinXP
 	1st usage 	220 	281 	258 	145 	182
 Subsequent usage 	130 	145 	136 	89 	84
Comment 17 Marian Mirilovic 2005-12-14 16:23:42 UTC
verified