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 233275 - RunUtils.run works for several seconds with no progress indication
Summary: RunUtils.run works for several seconds with no progress indication
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords: PERFORMANCE, USABILITY
Depends on:
Blocks:
 
Reported: 2013-07-23 22:51 UTC by Jesse Glick
Modified: 2013-07-27 02:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Snapshot (117.46 KB, application/octet-stream)
2013-07-23 22:51 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2013-07-23 22:51:11 UTC
Created attachment 137657 [details]
Snapshot

When I ask to build a Maven project, either from context menu or F11 or whatever, very often the IDE spends several seconds computing something before the Output Window even opens. No progress is shown during this time; there is no feedback of any kind that the IDE even registered your request to run a build.

I captured a profiler snapshot showing RunUtils.run calling MavenEmbedder.readProjectWithDependencies, taking >9s in my case. Please show a progress bar or something during this time.
Comment 1 Milos Kleint 2013-07-24 07:16:11 UTC
the problem is in some of the prerequisites checkers calling getMavenProject() that is lazily computed. The progress bar is then only created in MavenCommandLineExecutor.run().
But to get there from RunUtils.run() we need to pass RunUtils.executeMaven() both of which are friend apis and each has it's own usecases. On top of that the progresshandle needs to be passed an Action in constructor that knows about MavenCommandLineExecutor fields.

I don't see a simple fix here. Maybe some sort of workaround that would just print something to the status bar..
Comment 2 Jesse Glick 2013-07-24 17:16:53 UTC
The progress handle is the ideal place to show this, but just emitting a message to the status bar as soon as the action is invoked (*) would help a lot in terms of perceived responsiveness: would keep me from wondering whether my finger only grazed the F11 key. Sometimes I wind up running a build twice because there was no apparent response from the IDE the first time.

(*) IIRC you can set this notification to get cleared deterministically when the build is actually starting, so it would not be a distraction to people whose builds start quickly. I guess you could even start a timer when the action is invoked and show the message only if ~300ms has elapsed without prerequisite checkers or whatever completing.
Comment 3 Milos Kleint 2013-07-25 13:14:35 UTC
maybe org.openide.util.Utilities.createProgressCursor() for the time until we reach the progress bar?
Comment 4 Jesse Glick 2013-07-25 13:48:26 UTC
That sounds right.
Comment 5 Milos Kleint 2013-07-26 07:49:05 UTC
http://hg.netbeans.org/core-main/rev/37593675cc6a
Comment 6 Jesse Glick 2013-07-26 13:01:52 UTC
A progress cursor is fine, but I fear that showing a glass pane will just make the problem worse: not only will I have to wait ten seconds before my build starts, but I will be unable to do any other work during that time. A simple status line message seems less intrusive.
Comment 7 Milos Kleint 2013-07-26 13:05:07 UTC
not in my experience, I've added a Thread.sleep() and any activity on my side seemed work fine
Comment 8 Quality Engineering 2013-07-27 02:20:51 UTC
Integrated into 'main-silver', will be available in build *201307262300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/37593675cc6a
User: Milos Kleint <mkleint@netbeans.org>
Log: #233275 show some kind of progress indication before we reach the actual execution with a progress bar.