1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Performance improving in the DeltaProcessor

This commit is contained in:
Alain Magloire 2004-03-01 02:03:16 +00:00
parent 07f291d778
commit 7ba1b68964
4 changed files with 46 additions and 8 deletions

View file

@ -1,3 +1,17 @@
2004-02-29 Alain Magloire
Performance improvements in the Deltaprocessing
In the CContainerInfo.nonCResources() do not try
to recreate the ICElement.
Fire Deltas when Binaries are deleted to update
the BinaryContainer.
The DeltaProcessor was close()ing the Openable
uncessary leading to performance lost.
* model/org/eclipse/cdt/internal/core/model/CContainerInfo.java
* model/org/eclipse/cdt/internal/core/model/CModelManager.java
* model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
2004-02-28 Alain Magloire
Fix PE Parser

View file

@ -59,11 +59,23 @@ public class CContainerInfo extends OpenableInfo {
if (resources != null) {
CModelManager factory = CModelManager.getDefault();
for (int i = 0; i < resources.length; i++) {
// Check for Valid C projects only.
ICElement celement = factory.create(parent, resources[i]);
if (celement == null) {
ICElement[] children = getChildren();
boolean found = false;
for (int j = 0; j < children.length; j++) {
IResource r = children[j].getResource();
if (r.equals(resources[i])){
found = true;
break;
}
}
if (!found) {
notChildren.add(resources[i]);
}
// Check for Valid C projects only.
//ICElement celement = factory.create(parent, resources[i]);
//if (celement == null) {
// notChildren.add(resources[i]);
//}
}
}
} catch (CoreException e) {

View file

@ -311,12 +311,18 @@ public class CModelManager implements IResourceChangeListener {
CProject cproj = (CProject)celement.getCProject();
ArchiveContainer container = (ArchiveContainer)cproj.getArchiveContainer();
container.removeChild(celement);
CElementDelta delta = new CElementDelta(getCModel());
delta.changed(container, ICElementDelta.CHANGED);
registerCModelDelta(delta);
} else if (type == ICElement.C_BINARY) {
if (! ((IBinary)celement).isObject()) {
//System.out.println("RELEASE Binary " + cfile.getElementName());
CProject cproj = (CProject)celement.getCProject();
BinaryContainer container = (BinaryContainer)cproj.getBinaryContainer();
container.removeChild(celement);
CElementDelta delta = new CElementDelta(getCModel());
delta.changed(container, ICElementDelta.CHANGED);
registerCModelDelta(delta);
}
}

View file

@ -375,10 +375,19 @@ public class DeltaProcessor {
}
}
/**
* Add the resource delta to the right CElementDelta tree.
* @param parent
* @param delta
*/
protected void nonCResourcesChanged(ICElement parent, IResourceDelta delta) {
CElementDelta elementDelta = fCurrentDelta.find(parent);
if (elementDelta == null) {
fCurrentDelta.changed(parent, ICElementDelta.F_CONTENT);
elementDelta = fCurrentDelta.find(parent);
if (elementDelta != null) {
elementDelta.addResourceDelta(delta);
}
} else {
elementDelta.addResourceDelta(delta);
}
@ -443,15 +452,12 @@ public class DeltaProcessor {
updateIndexRemoveResource(element, delta);
}
}
} else if ((flags & IResourceDelta.DESCRIPTION) != 0) {
}
if ((flags & IResourceDelta.DESCRIPTION) != 0) {
if (element != null) {
elementAdded(element, delta);
}
} else if (element != null) {
elementChanged(element, delta);
}
} else if (element != null) {
elementChanged(element, delta);
}
break;
}