Commit a9412e2
committed
Improve progress reporting in ClasspathContainerState
Updated the run method to drain the workQueue into a local list at the
start. This allows for an accurate count of pending tasks and prevents
the performance penalty of calling ConcurrentLinkedQueue.size() (which
is O(n)) inside the loop.
Removed the repeated monitor.setWorkRemaining(WORK) call inside the
loop, which was causing the progress bar to reset and appear stuck.
Implemented logic to estimate work: count * 2 ticks are allocated
initially (assuming 1 tick for checking and 1 tick for potential
update). This seems a bit too much for the classpath update in my test
environment but is much better then before and it is difficult to judge
how long the classpath update will actually take.
Updated monitor.worked(1) to happen for every processed request.
Adjusted the remaining work for the final phase (setProjectContainers)
based on the actual number of projects requiring updates.
In a small / fast environment you may want to a Thread.sleep() to the
loop, in my client environment with > 900 bundles the process is not
much better visible.1 parent df29a67 commit a9412e2
File tree
1 file changed
+19
-9
lines changed- ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core
1 file changed
+19
-9
lines changedLines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
| |||
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
102 | | - | |
| 100 | + | |
| 101 | + | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
| |||
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
118 | | - | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | | - | |
127 | 135 | | |
128 | 136 | | |
| 137 | + | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| |||
151 | 160 | | |
152 | 161 | | |
153 | 162 | | |
154 | | - | |
| 163 | + | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
| |||
0 commit comments