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 194459 - "Scanning projects..." progress handle should show approx. percentage completion
Summary: "Scanning projects..." progress handle should show approx. percentage completion
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: UI
: 187263 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-19 00:49 UTC by Jesse Glick
Modified: 2011-02-07 15:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sketch of patch; seems to work, but probably missing support for corner cases (2.77 KB, patch)
2011-01-19 01:34 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-01-19 00:49:46 UTC
Since after collecting dependencies the Parsing API presumably knows how many source roots it will be scanning, its progress handle should show percentage completion (under the assumption each root will take about the same amount of time).
Comment 1 Jesse Glick 2011-01-19 01:34:55 UTC
Created attachment 105128 [details]
Sketch of patch; seems to work, but probably missing support for corner cases
Comment 2 Vladimir Voskresensky 2011-01-19 09:39:52 UTC
have a look at org.netbeans.modules.cnd.modelimpl.platform.ParsingProgress which can give you a hint how to show progress with "not-known-from-the-beginning" number of work items. It can help to solve corner cases
Comment 3 Tomas Zezula 2011-01-19 15:08:29 UTC
I will look at it on Friday.
Comment 4 Jesse Glick 2011-01-19 15:10:49 UTC
(In reply to comment #2)
> how to show progress with "not-known-from-the-beginning" number of work items

In this case we do in fact know how many work items are to be processed near the beginning (after "Collecting dependencies..." is done). And the progress bar seemed to work fine for the cases I was able to test by hand - by just opening and closing Java projects. There are just several other places where progress messages are printed but that I was not able to reproduce, and I was not sure if it was important to provide numerical progress for these, or if the patch would actively harm those procedures.
Comment 5 Tomas Zezula 2011-01-19 15:15:55 UTC
Right, after the topological sort and diff of the old and new state the roots which should be scanned are known. The progress update should be done in scanSource and scanBinary. The only problem is that the project may have different size (number of files) or if there is just one project (root) - the progress may be strange. But it is much better than the current state.
Comment 6 Jesse Glick 2011-01-19 15:31:38 UTC
(In reply to comment #5)
> the project may have
> different size (number of files) or if there is just one project (root) - the
> progress may be strange.

Right, I made no attempt to do anything special for the case that there is just one (or a small number) of roots and they are huge, or there is one huge root and a lot of little ones. I was rather assuming that scanning an individual root is _usually_ fast enough that you do not need detailed progress, but that there could be hundreds of roots to be scanned that together will take several minutes; in this case the progress computed just by fraction of roots processed is very helpful.

Tweaks are possible. For example, count source roots double (at least), since they are likely to be slower than binary roots to process. You can estimate the time for a binary root based on JAR size; I doubt it is possible to estimate the size of a source root without doing a double pass over the directory tree, which is bad for disk throughput.
Comment 7 Tomas Zezula 2011-01-25 16:51:52 UTC
Fixed jet-main 4f7bdc504f50
Comment 8 Tomas Zezula 2011-01-25 16:53:24 UTC
In future we can improve the precision in up to date check. During the up to date check we have timestamps map so we know the estimate of file count in source root.
Comment 9 Quality Engineering 2011-01-27 08:32:59 UTC
Integrated into 'main-golden', will be available in build *201101270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4f7bdc504f50
User: Tomas Zezula <tzezula@netbeans.org>
Log: #194459:"Scanning projects..." progress handle should show approx. percentage completion
Comment 10 Tomas Zezula 2011-02-07 15:12:17 UTC
*** Bug 187263 has been marked as a duplicate of this bug. ***