Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] findFileName & fileFilePath - Is it a costly operation ?

> 
>  Could somebody help me to find an answer to this question ?
> 
> Thanks,
> Bala 
> 
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On
> Behalf Of Balasubramaniyan K
> Sent: Tuesday, May 10, 2005 8:09 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] findFileName & fileFilePath - Is it a costly operation ?
> 
> Hi,
> 
> 	I was reading through the code of GCCErrorParser.java , the file
> which splits the error messages in to different tokens of fileName,
> lineNumber , severity, error no & resource.
> 
> 	The path of the file of the offended source code is obtained by
> either of the two methods shown below:
> 		IFile file = eoParser.findFileName(fileName);
> 		IFile  file = eoParser.findFilePath(fileName);
> 
> 	If I understand right,  these methods identify the path recursively
> throughout the project in the workspace based on filename. If this
> understanding being right, won't this search be
> 	 a costly operation if the project in the workspace has around 500
> files or more.
> 
> 	Can you throw some thoughts on this ?
> 

findFileName() && findFilePath() do not recursively search the project, they look at the HashMap.  

However the collectFiles() method is call once and will traverse the project.  But
this is done with a visitor, IResourceProxyVisitor.  This mechanism is fast since the
workspace is partly cache.

Do you see any noticable slow down ?



Back to the top