mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 10:25:32 +02:00
Fix computation of time for parser without resolution and index update
This commit is contained in:
parent
dabcfe8c2b
commit
e36cb0d76f
1 changed files with 58 additions and 55 deletions
|
@ -338,7 +338,7 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
|
||||||
|
|
||||||
protected void addSymbols(IASTTranslationUnit ast, IProgressMonitor pm) throws InterruptedException, CoreException {
|
protected void addSymbols(IASTTranslationUnit ast, IProgressMonitor pm) throws InterruptedException, CoreException {
|
||||||
final Map symbolMap= new HashMap();
|
final Map symbolMap= new HashMap();
|
||||||
|
try {
|
||||||
String[] orderedPaths= extractSymbols(ast, symbolMap);
|
String[] orderedPaths= extractSymbols(ast, symbolMap);
|
||||||
for (int i=0; i<orderedPaths.length; i++) {
|
for (int i=0; i<orderedPaths.length; i++) {
|
||||||
if (pm.isCanceled()) {
|
if (pm.isCanceled()) {
|
||||||
|
@ -397,8 +397,11 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
|
||||||
index.releaseWriteLock(getReadlockCount());
|
index.releaseWriteLock(getReadlockCount());
|
||||||
}
|
}
|
||||||
fAddToIndexTime+= System.currentTimeMillis()-start;
|
fAddToIndexTime+= System.currentTimeMillis()-start;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
fCompletedSources++;
|
fCompletedSources++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String[] extractSymbols(IASTTranslationUnit ast, final Map symbolMap) throws CoreException {
|
private String[] extractSymbols(IASTTranslationUnit ast, final Map symbolMap) throws CoreException {
|
||||||
LinkedHashSet orderedIncludes= new LinkedHashSet();
|
LinkedHashSet orderedIncludes= new LinkedHashSet();
|
||||||
|
@ -514,7 +517,7 @@ public abstract class PDOMIndexerTask implements IPDOMIndexerTask {
|
||||||
|
|
||||||
System.out.println(name + " Timings: " //$NON-NLS-1$
|
System.out.println(name + " Timings: " //$NON-NLS-1$
|
||||||
+ (System.currentTimeMillis() - start) + " total, " //$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$
|
+ fResolutionTime + " resolution, " //$NON-NLS-1$
|
||||||
+ fAddToIndexTime + " index update."); //$NON-NLS-1$
|
+ fAddToIndexTime + " index update."); //$NON-NLS-1$
|
||||||
System.out.println(name + " Result: " //$NON-NLS-1$
|
System.out.println(name + " Result: " //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue