Bug 91558 - Refresh slow in CVS Repositories view
Summary: Refresh slow in CVS Repositories view
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-04-15 11:23 EDT by Ed Burnette CLA
Modified: 2005-04-18 22:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Burnette CLA 2005-04-15 11:23:14 EDT
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
Comment 1 John Arthorne CLA 2005-04-15 11:29:41 EDT
See bug 90096.
Comment 2 Billy Biggs CLA 2005-04-15 11:41:09 EDT
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.
Comment 3 Billy Biggs CLA 2005-04-15 12:50:06 EDT

*** This bug has been marked as a duplicate of 90096 ***
Comment 4 Billy Biggs CLA 2005-04-18 13:38:04 EDT
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?
Comment 5 Billy Biggs CLA 2005-04-18 15:29:03 EDT
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() {
Comment 6 Michael Valenta CLA 2005-04-18 15:45:17 EDT
I have released Billy's change for tomorrow's I-build.
Comment 7 Billy Biggs CLA 2005-04-18 18:36:30 EDT
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.
Comment 8 Ed Burnette CLA 2005-04-18 22:34:01 EDT
XP with all effects turned on.