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 47075 - Creating of a new project blocks AWT
Summary: Creating of a new project blocks AWT
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows 3.1/NT
: P2 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-08-11 09:02 UTC by Jan Chalupa
Modified: 2007-09-26 09:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A series of thread dumps taken while creating a new project (61.02 KB, text/plain)
2004-08-11 14:41 UTC, Jan Chalupa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Chalupa 2004-08-11 09:02:25 UTC
[dev-20040811, JDK 1.4.2_04]

I'm running the IDE with a clean userdir. I create
a new J2SE App, fill in the wizard fields and
press Finish. The next 10 seconds (or so) I'm
looking at incompletely redrawn UI and waiting for
the project to be created.

Very poor user experience.
Comment 1 Marian Mirilovic 2004-08-11 10:05:59 UTC
probably dup of issue 47072

Honza, do you have some thread-dump ?
Comment 2 Jan Chalupa 2004-08-11 10:18:42 UTC
Hmm, I don't think it's a duplicate. I'm told that issue #47072 is
caused by the navigation view in Editor. However, the problem
described here occurs immediately after the Project wizard is closed
and before the editor is opened and the classpath scanning kicks in. I
can try to generate a thread dump, of course.
Comment 3 Jan Chalupa 2004-08-11 14:41:05 UTC
Created attachment 16755 [details]
A series of thread dumps taken while creating a new project
Comment 4 Jan Chalupa 2004-08-11 14:43:37 UTC
See the attached console log with 5 thread dumps captured while the
new project was opening. I don't see anything related to issue #47072
there.
Comment 5 Petr Hrebejk 2004-08-11 17:29:34 UTC
Jesse please look at it but I really don't think this is ours. Do you?
Comment 6 Jesse Glick 2004-08-11 20:18:50 UTC
Doesn't look to me like it has much to do with the project system.
Thread dumps:

#1 - DataObject.find on a *.java file on the system file system (a
template).

#2 & #3 - some parsing stuff I don't understand in
JavaDataObject.handleCreateFromTemplate.

#4 - a mystery to me, just opening the file, not sure what it is
waiting for.

Four thread dumps are not enough to see any particular pattern here.

Is this a regression? Since when? I do not believe anything of
interest has changed in J2SEProjectGenerator etc. recently. Perhaps
something new in javacore.
Comment 7 Jan Becicka 2004-08-12 06:50:19 UTC
Problem seems to be in JavaDataObject.handleCreateFromTemplate(). See
numbers.

Regular instantiation of Java template: 0.25s
Instantiation of Java templete during creation of very first project:
2.5s!
Instantiation of Java templete during creation of project (not very
first): 0.75s.
Comment 8 Martin Matula 2004-08-12 08:10:56 UTC
Yes, this is the problem we have talked about when we started to
migrate our infrastructure to the new buildsystem. We have managed to
minimize the time when AWT is blocked. The 2.5s is spent in creation
of the storage partition for the new classpath element that the new
file is created in. I don't see how we can minimize it significantly,
so it would be helpful if the project generator could move the new
file creation from the AWT thread.
Comment 9 Jesse Glick 2004-08-12 08:31:55 UTC
Adding Petr & Jirka to CC in light of the last comment. I am not sure
if it is straightforward to make the new file creation asynchronous,
since after the wizard returns a Set<Object> the wizard infrastructure
needs to continue working (to select newly created files and projects).

Again, is this a recent problem or have the same measurements existed
for a long time? I have certainly never seen a 10 second pause.
Comment 10 Jan Becicka 2004-08-12 08:42:04 UTC
AFAIK JavaDataObject.handleCreateFromTemplate() and related code is in
trunk since refactoring merge.
I cannot reproduce 10s hang, but only 3s, which is still bad.
Comment 11 Jan Chalupa 2004-08-12 08:46:21 UTC
I don't think this is necessarily a regression or new problem. I just
noticed yesterday that creating of a new project takes long (excluding
classpath scanning, of course) and AWT is blocked. Perhaps, it just
stroke me now with the new dark blue welcome screen. The gray
unpainted rectangle (left after the disappearing Project wizard) on
the blue background looks ugly and it doesn't update for several
seconds. Another reason might be that my machine is pretty slow (PIII,
800 MHz, 384 MB RAM).
Comment 12 Petr Hrebejk 2004-08-12 12:04:34 UTC
We looked at that once with Jarda I think. What helped was to move the
NewFile action out of the AWT and then of course replan the node
selctions etc back to AWT. I even still might have patch for it
somewhere. I can try to commit it. But rathen not for the Beta1. BTW I
think that this is in fact defficiency of the Wizards API which does
not allow to let the wizard stay painted (but with an progess cursor)
and close it after all the time consuming work is done.
Comment 13 Petr Hrebejk 2004-08-16 10:40:04 UTC
Now hourglass curor is shown after creation of new project. And the
wizard disappears without leaving the ugly grey box. However the
creation of first project is still a bit slow. Maybe file another bug
and let the performace team to investigate why.


Checking in
projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java,v
 <--  ProjectUtilities.java
new revision: 1.9; previous revision: 1.8
done
Processing log script arguments...
More commits to come...
Checking in
projectui/src/org/netbeans/modules/project/ui/actions/NewProject.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/NewProject.java,v
 <--  NewProject.java
new revision: 1.13; previous revision: 1.12
done
Comment 14 Antonin Nebuzelsky 2004-08-16 11:21:13 UTC
Can this change be integrated to the beta branch as well? Creating a
new project is gonna be quite frequent step for the beta users I guess.
Comment 15 Petr Hrebejk 2004-08-16 11:53:50 UTC
We decided no to.
Comment 16 Jan Chalupa 2004-08-20 09:53:12 UTC
Verified in dev-200408181800. Creating a new project for the first
time still takes pretty long, but the user experience is much better.
UI updates fine.