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

Fix computation of time for parser without resolution and index update

This commit is contained in:
Markus Schorn 2006-12-05 14:19:30 +00:00
parent dabcfe8c2b
commit e36cb0d76f

View file

@ -338,7 +338,7 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
protected void addSymbols(IASTTranslationUnit ast, IProgressMonitor pm) throws InterruptedException, CoreException {
final Map symbolMap= new HashMap();
try {
String[] orderedPaths= extractSymbols(ast, symbolMap);
for (int i=0; i<orderedPaths.length; i++) {
if (pm.isCanceled()) {
@ -397,8 +397,11 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
index.releaseWriteLock(getReadlockCount());
}
fAddToIndexTime+= System.currentTimeMillis()-start;
}
finally {
fCompletedSources++;
}
}
private String[] extractSymbols(IASTTranslationUnit ast, final Map symbolMap) throws CoreException {
LinkedHashSet orderedIncludes= new LinkedHashSet();
@ -514,7 +517,7 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
System.out.println(name + " Timings: " //$NON-NLS-1$
+ (System.currentTimeMillis() - start) + " total, " //$NON-NLS-1$
+ fParsingTime + " parser, " //$NON-NLS-1$
+ (fParsingTime-fResolutionTime-fAddToIndexTime) + " parser, " //$NON-NLS-1$
+ fResolutionTime + " resolution, " //$NON-NLS-1$
+ fAddToIndexTime + " index update."); //$NON-NLS-1$
System.out.println(name + " Result: " //$NON-NLS-1$