Bug 3358 - Performance: indexer doing too much work? (1GJLDN7)
Summary: Performance: indexer doing too much work? (1GJLDN7)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:53 EDT by John Arthorne CLA
Modified: 2002-01-11 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2001-10-10 22:53:47 EDT
While doing performance tracing in OptimizeIt, I noticed that the indexer thread was doing
work in situations where it seems like it shouldn't.  For example, if you do a "Team->Synchronize with Stream",
it re-indexes all java files, even though their content hasn't changed.  I traced this down to
DeltaProcessor#updateIndex, which has the following code for dealing with changed java files:

			IFile file = (IFile)delta.getResource();
			String extension;
			switch (delta.getKind()) {
				case IResourceDelta.ADDED:
				case IResourceDelta.CHANGED:
					if (file.isLocal(IResource.DEPTH_ZERO)) indexManager.add(file);
					break;
				case IResourceDelta.REMOVED:
					extension = file.getFileExtension();
					indexManager.remove(file.getFullPath().toString(), file.getProject());
					break;
			}

Under the CHANGED case, it should only be concerned with deltas with the F_CONTENT
flag set, otherwise the indexes shouldn't be affected. As it is now, it will re-index files
with sync info changes, session property changes, marker changes, etc, unnecessarily.
This is causing a lot of unnecessary work in the index thread.

NOTES:

PM (9/6/2001 3:16:59 PM)
	Agreed, we should not reindex the world unless the content has changed.

JohnA (9/6/2001 10:08:52 AM)
	There may be other opportunities to improve the java delta processor performance
	in this case.  When doing "Synchronize with Stream" on a typical java project, 20-30% 
	of the total time is taken in jdt.internal.core.DeltaProcessor.processResourceDelta.  Most of 
	that time seems to be taken in creating java elements corresponding to the changed resources.
	This could perhaps be improved in cases where the delta does not represent content changes.

PM (9/17/2001 1:26:13 PM)
	Checking the flags for reconciling with .classpath file and triggering file indexing.
Comment 1 DJ Houghton CLA 2001-10-29 17:12:03 EST
PRODUCT VERSION:

0.131

Comment 2 Philipe Mulet CLA 2001-11-29 09:26:32 EST
I guess that second point from JA will be solved by your current effort on the 
delta processor.
Comment 3 Jerome Lanneluc CLA 2001-11-30 13:22:40 EST
Rewrote DeltaProcessor:
- it now ignores changes if they are not content changes
- it creates handles only for element that have been added, removed or if their 
content has changed. It doesn't create handles for intermediate elements as it 
used to do.
- it handle changes in package fragment roots that are common to multiple 
projects correctly.