mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
Fix for 189127: Opening project with per file scanner discovery is extremely slow
This commit is contained in:
parent
271f65a6db
commit
f242866c6b
2 changed files with 14 additions and 14 deletions
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.core.scannerconfig2;
|
package org.eclipse.cdt.make.internal.core.scannerconfig2;
|
||||||
|
|
||||||
|
@ -24,13 +25,11 @@ import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
import java.util.Map.Entry;
|
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.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.PathInfo;
|
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner;
|
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
|
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.ScannerInfoTypes;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
|
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
|
||||||
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
|
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.ScannerConfigUtil;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
|
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.CygpathTranslator;
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.KVStringPair;
|
|
||||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
|
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.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
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.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
@ -844,7 +839,9 @@ public class PerFileSICollector implements IScannerInfoCollector3, IScannerInfoC
|
||||||
}
|
}
|
||||||
for (Iterator j = discovered.iterator(); j.hasNext(); ) {
|
for (Iterator j = discovered.iterator(); j.hasNext(); ) {
|
||||||
String include = (String) j.next();
|
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)) {
|
if (!allIncludes.contains(include)) {
|
||||||
allIncludes.add(include);
|
allIncludes.add(include);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.model;
|
package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
|
@ -91,11 +92,13 @@ public abstract class APathEntry extends PathEntry {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < excludeLength; i++) {
|
for (int i = 0; i < excludeLength; i++) {
|
||||||
// compare toStrings instead of IPaths
|
if (exclusionPatterns[i] != otherExcludes[i]) {
|
||||||
// since IPath.equals is specified to ignore trailing separators
|
// compare toStrings instead of IPaths
|
||||||
String myPattern = exclusionPatterns[i].toString();
|
// since IPath.equals is specified to ignore trailing separators
|
||||||
if (!myPattern.equals(otherExcludes[i].toString())) {
|
String myPattern = exclusionPatterns[i].toString();
|
||||||
return false;
|
if (!myPattern.equals(otherExcludes[i].toString())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue