1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Fix for 189127: Opening project with per file scanner discovery is extremely slow

This commit is contained in:
Anton Leherbauer 2007-05-25 13:52:38 +00:00
parent 271f65a6db
commit f242866c6b
2 changed files with 14 additions and 14 deletions

View file

@ -8,6 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Anton Leherbauer (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.make.internal.core.scannerconfig2;
@ -24,13 +25,11 @@ import java.util.SortedSet;
import java.util.TreeSet;
import java.util.Map.Entry;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IIncludeEntry;
import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.PathInfo;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner;
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
import org.eclipse.cdt.make.core.scannerconfig.PathInfo;
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
@ -41,14 +40,10 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoSto
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.KVStringPair;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@ -844,7 +839,9 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
}
for (Iterator j = discovered.iterator(); j.hasNext(); ) {
String include = (String) j.next();
include = CCommandDSC.makeRelative(project, new Path(include)).toPortableString();
// the following line degrades perfomance
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=189127
// include = CCommandDSC.makeRelative(project, new Path(include)).toPortableString();
if (!allIncludes.contains(include)) {
allIncludes.add(include);
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2006 QNX Software Systems and others.
* Copyright (c) 2000, 2007 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
*
* Contributors:
* QNX Software Systems - Initial API and implementation
* Anton Leherbauer (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
@ -91,11 +92,13 @@ public abstract class APathEntry extends PathEntry {
return false;
}
for (int i = 0; i < excludeLength; i++) {
// compare toStrings instead of IPaths
// since IPath.equals is specified to ignore trailing separators
String myPattern = exclusionPatterns[i].toString();
if (!myPattern.equals(otherExcludes[i].toString())) {
return false;
if (exclusionPatterns[i] != otherExcludes[i]) {
// compare toStrings instead of IPaths
// since IPath.equals is specified to ignore trailing separators
String myPattern = exclusionPatterns[i].toString();
if (!myPattern.equals(otherExcludes[i].toString())) {
return false;
}
}
}
}