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.
Summary: | [40cat] Run large j2seproject with no main class set takes long time to initialize list of possible main classes | ||
---|---|---|---|
Product: | java | Reporter: | meliandra <meliandra> |
Component: | Project | Assignee: | Jiri Rechtacek <jrechtacek> |
Status: | CLOSED FIXED | ||
Severity: | blocker | CC: | issues, jglick, jrechtacek, mmirilovic, pjiricka |
Priority: | P2 | Keywords: | PERFORMANCE |
Version: | 4.x | ||
Hardware: | PC | ||
OS: | Windows ME/2000 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 44105 | ||
Attachments: |
Bild 1
Bild 2 |
Description
meliandra
2004-08-19 14:46:56 UTC
> In the project is no main class set - so it takes a long time until
all available classes are shown
what do you mean by "all available classes are shown"?
Created attachment 16956 [details]
Bild 1
Created attachment 16957 [details]
Bild 2
I've attached a picture of the dialog. I've also stopped the time - 2:30. At least you can cancel this job. Nobody will do this twice. meliandra, thanks for explanation ... reassigne to appropriate module for evaluation Doubt there is anything to be done from the j2seproject side; it just asks JMI for a list of classes with a main method. If JMI takes a long time to report back, the dialog just waits. Of course you can just type in the specific main class you want in the project's properties dialog, so this is hardly a priority bug IMHO, especially since the choice of main class is normally intended to be a one-time decision, not each time you run. (If you want to run a particular class on a one-off basis without setting it as the main class, you can, just using Shift-F6.) Jesse, could you please point me to the code in projects that retrieves the list so that I could check whether it could use javacore more effectively? ...I mean efficiently :) MainClassChooser.getAllMainClasses (in java/j2seproject). Actually it looks like it is using the old srcmodel - is this going to add overhead? All Jirka's code I believe, adding him to CC though I think I heard he was on vacation. Note that the search is just a depth-first enumeration of all classes in the source root, so without some kind of index it is going to be O(n). Note also that the project in question probably has to be open, so the source root should be in the merged classpath. Wow! I believe this can be improved very significantly. At least we could give you just the files that contain "main" identifier and you could inspect only those. We do that already e.g. when a package is expanded and we need to create icon badges. Using JMI instead of the old src hierarchy should also be faster. We can help Jirka to implement that, however there might be one problem - j2seproject would need to have an implementation dependency on javacore (at least for this release) since there is no API for getting all files containing a given identifier yet. Would that be acceptable? I think a temporary impl dependency on javacore would be acceptable. Of course if there is a proper API later (in javamodel?) that would be better. Please reassign to Jirka when you think there is a usable friend API (or immediately if he could start using JMI in place of srcmodel to get some performance benefit). This is definitely not P4, it is veeeeeery sloooooow. Makes the feature almost unusable. Jirka you're back right? *** Issue 45422 has been marked as a duplicate of this issue. *** Petr J. copied the same code into web projects :-( http://web.netbeans.org/source/browse/web/project/src/org/netbeans/modules/web/project/WebActionProvider.java.diff?r1=1.29&r2=1.30 So don't forget we have to fix it in webapps too. Yes, we have to temporary depend on javacore but also on jmi, jmiutils and mdr as well. Other possibility is dependency on java (Java Source Files) project. Support javacore/jmimodel is used to obtain and check the project's main classes. Made new two dependency to java/javacore and jmimodel. The java module uses other dependencies which hasn't been forced in j2seproject yet. fixed in j2seproject/build.xml; /cvs/java/j2seproject/build.xml,v <-- build.xml new revision: 1.4; previous revision: 1.3 done Processing log script arguments... More commits to come... Checking in j2seproject/nbproject/project.properties; /cvs/java/j2seproject/nbproject/project.properties,v <-- project.properties new revision: 1.7; previous revision: 1.6 done Checking in j2seproject/nbproject/project.xml; /cvs/java/j2seproject/nbproject/project.xml,v <-- project.xml new revision: 1.11; previous revision: 1.10 done Processing log script arguments... More commits to come... Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java,v <-- J2SEActionProvider.java new revision: 1.23; previous revision: 1.22 done Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectUtil.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectUtil.java,v <-- J2SEProjectUtil.java new revision: 1.3; previous revision: 1.2 done Processing log script arguments... More commits to come... Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/MainClassChooser.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/MainClassChooser.java,v <-- MainClassChooser.java new revision: 1.19; previous revision: 1.18 done Processing log script arguments... More commits to come... Checking in javacore/src/org/netbeans/modules/javacore/ClassIndex.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/ClassIndex.java,v <-- ClassIndex.java new revision: 1.14; previous revision: 1.13 done Verifying as fixed w/ trunk build 200409011800. I tried with jEdit project. It took 9 seconds to present the list of main classes, while with a build before this fix I measured 70 seconds. I do not know how long it will take for your project, meliandra, and if it is acceptable for you now. Feel free to reopen. |