Community
Participate
Working Groups
I20050413-0910 with HEAD platform UI (as of 20050414) and latest patches for bug 89280. But I've seen the problem before, just haven't reported it before now. In the CVS Repository view, when you click on the Refresh button, if you have a couple thousand items in the tree and you're running on Windows it takes a few seconds. First you see the scroll bar thumb get bigger and bigger as items are sucked out of the tree, then there's a flash, then items start populating back in and the scroll bar gets smaller and smaller. The Eclipse UI is unresponsive during this period. If you plug the speakers in you'll hear a "woooOP! Whoooo" sound as this happens (j/k). I've verivied it has nothing to do with fetching info from CVS and everything to do with the TreeViewer.refresh() call. A setRedraw in the right place can fix this but I'm not sure where to put it. See also mail in the platform-ui-dev group (search for viewer.getControl().setRedraw(false);) Traceback during the removal phase: Thread [main] (Suspended) OS.CallWindowProcW(int, int, int, int, int) line: not available [native method] OS.CallWindowProc(int, int, int, int, int) line: 1553 Tree.callWindowProc(int, int, int, int) line: 223 Tree(Control).windowProc(int, int, int, int) line: 3113 Tree.windowProc(int, int, int, int) line: 2360 Display.windowProc(int, int, int, int) line: 3467 OS.SendMessageW(int, int, int, int) line: not available [native method] OS.SendMessage(int, int, int, int) line: 2202 Tree.destroyItem(TreeItem) line: 745 TreeItem.releaseChild() line: 768 TreeItem(Widget).dispose() line: 379 TreeViewer(AbstractTreeViewer).updateChildren(Widget, Object, Object[], boolean) line: 1712 TreeViewer(AbstractTreeViewer).internalRefreshStruct(Widget, Object, boolean) line: 1252 TreeViewer(AbstractTreeViewer).internalRefreshStruct(Widget, Object, boolean) line: 1259 TreeViewer(AbstractTreeViewer).internalRefreshStruct(Widget, Object, boolean) line: 1259 TreeViewer(AbstractTreeViewer).internalRefresh(Widget, Object, boolean, boolean) line: 1229 TreeViewer(AbstractTreeViewer).internalRefresh(Object, boolean) line: 1185 TreeViewer(AbstractTreeViewer).internalRefresh(Object) line: 1172 StructuredViewer$7.run() line: 1254 TreeViewer(StructuredViewer).preservingSelection(Runnable) line: 1191 TreeViewer(StructuredViewer).refresh(Object) line: 1252 TreeViewer(StructuredViewer).refresh() line: 1211 RepositoriesView(RemoteViewPart).refreshViewer() line: 353 RepositoriesView(RemoteViewPart).refreshAll() line: 344 RemoteViewPart$2.run() line: 187 RemoteViewPart$2(Action).runWithEvent(Event) line: 996 ActionContributionItem.handleWidgetSelection(Event, boolean) line: 538 ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 488 ActionContributionItem$6.handleEvent(Event) line: 441 EventTable.sendEvent(Event) line: 82 ToolItem(Widget).sendEvent(Event) line: 842 Display.runDeferredEvents() line: 2895 Display.readAndDispatch() line: 2528 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1570 Workbench.runUI() line: 1534 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 306 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 143 IDEApplication.run(Object) line: 103 PlatformActivator$1.run(Object) line: 228 EclipseStarter.run(Object) line: 344 EclipseStarter.run(String[], Runnable) line: 156 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, ......) line: 585 Main.invokeFramework(String[], URL[]) line: 316 Main.basicRun(String[]) line: 269 Main.run(String[]) line: 948 Main.main(String[]) line: 932 Traceback during the repopulate phase: Thread [main] (Suspended) OS.CallWindowProcW(int, int, int, int, int) line: not available [native method] OS.CallWindowProc(int, int, int, int, int) line: 1553 Tree.callWindowProc(int, int, int, int) line: 223 Tree(Control).windowProc(int, int, int, int) line: 3113 Tree.windowProc(int, int, int, int) line: 2360 Display.windowProc(int, int, int, int) line: 3467 OS.SendMessageW(int, int, int, TVINSERTSTRUCT) line: not available [native method] OS.SendMessage(int, int, int, TVINSERTSTRUCT) line: 2267 Tree.createItem(TreeItem, int, int) line: 456 TreeItem.<init>(TreeItem, int, int) line: 218 TreeViewer.newItem(Widget, int, int) line: 502 TreeViewer(AbstractTreeViewer).createTreeItem(Widget, Object, int) line: 525 TreeViewer(AbstractTreeViewer).createAddedElements(Widget, Object[]) line: 241 TreeViewer(AbstractTreeViewer).internalAdd(Widget, Object, Object[]) line: 181 TreeViewer(AbstractTreeViewer).add(Object, Object[]) line: 124 DeferredTreeContentManager$3.runInUIThread(IProgressMonitor) line: 276 UIJob$1.run() line: 93 RunnableLock.run() line: 35 UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 118 Display.runAsyncMessages(boolean) line: 2872 Display.readAndDispatch() line: 2531 ModalContext$ModalContextThread.block() line: 153 ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 303 ProgressMonitorJobsDialog(ProgressMonitorDialog).run(boolean, boolean, IRunnableWithProgress) line: 447 ProgressMonitorJobsDialog.run(boolean, boolean, IRunnableWithProgress) line: 261 ProgressManager$3.run() line: 866 BusyIndicator.showWhile(Display, Runnable) line: 69 ProgressManager.busyCursorWhile(Runnable, ProgressMonitorJobsDialog) line: 900 ProgressManager.busyCursorWhile(IRunnableWithProgress) line: 876 ProgressManager.run(boolean, boolean, IRunnableWithProgress) line: 1075 DateTagCategory(CVSModelElement).getChildren(Object, boolean) line: 89 DateTagCategory(CVSModelElement).getChildren(Object) line: 69 RemoteContentProvider(BaseWorkbenchContentProvider).getChildren(Object) line: 68 RemoteContentProvider.getChildren(Object) line: 101 RemoteContentProvider(BaseWorkbenchContentProvider).hasChildren(Object) line: 95 RemoteContentProvider.hasChildren(Object) line: 70 TreeViewer(AbstractTreeViewer).isExpandable(Object) line: 1353 TreeViewer(AbstractTreeViewer).updateChildren(Widget, Object, Object[], boolean) line: 1650 TreeViewer(AbstractTreeViewer).internalRefreshStruct(Widget, Object, boolean) line: 1252 TreeViewer(AbstractTreeViewer).internalRefreshStruct(Widget, Object, boolean) line: 1259 TreeViewer(AbstractTreeViewer).internalRefreshStruct(Widget, Object, boolean) line: 1259 TreeViewer(AbstractTreeViewer).internalRefresh(Widget, Object, boolean, boolean) line: 1229 TreeViewer(AbstractTreeViewer).internalRefresh(Object, boolean) line: 1185 TreeViewer(AbstractTreeViewer).internalRefresh(Object) line: 1172 StructuredViewer$7.run() line: 1254 TreeViewer(StructuredViewer).preservingSelection(Runnable) line: 1191 TreeViewer(StructuredViewer).refresh(Object) line: 1252 TreeViewer(StructuredViewer).refresh() line: 1211 RepositoriesView(RemoteViewPart).refreshViewer() line: 353 RepositoriesView(RemoteViewPart).refreshAll() line: 344 RemoteViewPart$2.run() line: 187 RemoteViewPart$2(Action).runWithEvent(Event) line: 996 ActionContributionItem.handleWidgetSelection(Event, boolean) line: 538 ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 488 ActionContributionItem$6.handleEvent(Event) line: 441 EventTable.sendEvent(Event) line: 82 ToolItem(Widget).sendEvent(Event) line: 842 Display.runDeferredEvents() line: 2895 Display.readAndDispatch() line: 2528 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 1570 Workbench.runUI() line: 1534 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 306 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 143 IDEApplication.run(Object) line: 103 PlatformActivator$1.run(Object) line: 228 EclipseStarter.run(Object) line: 344 EclipseStarter.run(String[], Runnable) line: 156 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object......) line: 585 Main.invokeFramework(String[], URL[]) line: 316 Main.basicRun(String[]) line: 269 Main.run(String[]) line: 948 Main.main(String[]) line: 932
See bug 90096.
Yep, I think this is clearly due to the change for bug 90096. Tod, I want to look into this a little more closely first.
*** This bug has been marked as a duplicate of 90096 ***
I should have read this bug more closely, as it appears I was too quick to blame this behaviour on the change in 90096 :) Because CVS uses a DeferredTreeContentManager, calling refresh() causes all of the subtrees to remove all of their elements and leave a "Pending..." item until the results come back in. When the Windows feature for animation is enabled, this can take a long time. Using setRedraw() around the call to refresh() improves this case a lot. Given that anyone who uses DeferredTreeContentManager could benefit from this, maybe it should be added at this layer?
I can't find any good place for this in the JFace code, and it seems like it is reasonable to do it in RemoveViewPart.java in the Team CVS code. Here is my suggested patch: Index: src/org/eclipse/team/internal/ccvs/ui/repo/RemoteViewPart.java =================================================================== RCS file: /home/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RemoteViewPart.java,v retrieving revision 1.17 diff -u -r1.17 RemoteViewPart.java --- src/org/eclipse/team/internal/ccvs/ui/repo/RemoteViewPart.java 5 Apr 2005 20:52:46 -0000 1.17 +++ src/org/eclipse/team/internal/ccvs/ui/repo/RemoteViewPart.java 18 Apr 2005 19:28:02 -0000 @@ -349,7 +349,9 @@ ((RemoteContentProvider)viewer.getContentProvider()).cancelJobs(CVSUIPlugin.getPlugin().getRepositoryManager().getKnownRepositoryRoots()); CVSUIPlugin.getPlugin().getRepositoryManager().purgeCache(); updateWorkingSetMenu(); + viewer.getControl().setRedraw(false); viewer.refresh(); + viewer.getControl().setRedraw(true); } public void collapseAll() {
I have released Billy's change for tomorrow's I-build.
Ed, just curious, are you running on Windows XP or Windows 2000? I was demonstrating this problem on a Win2k machine and it seemed exceptionally bad. If you are also on Win2k it would be an interesting data point.
XP with all effects turned on.