[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-dev] CDT performance: most frequently used methods
|
Hi all.
Some words about most time-consuming methods during CDT indexing
process.
See attach (obtained by JProbe 6.0 on Eclipse 3.2 + latest CDT).
Below are some comments regarding this picture.
1. CCorePlugin.getConentType(IProject, String) - method time is 4.2%
Many calls to platform. Under investigation. No propositions yet.
2. AbstractGNUSourceCodeParser.LT(int i) - 4%
In fact, method contains only one line:
{
LA(i).getType();
}
Note, we are counting this method time only,
"LA()" and IToken.getType() times are listed separately - see about
"getType()" below.
I really cannot imagine why LT() itself consumes so much, and how
can it be improved.
3. IToken.getType() - 3%.
All IToken implementations simply return "type" field value, but
this
method is called too frequently, so even extra function call
matters.
May be it would be better:
1. Define most abstract class "TypedToken" with "public int type"
field only.
2. Inherit all existing Token classes (DOMScanner._BasicToken etc)
from it.
3. When possible (in "LT()" etc), use "TypedToken.type" instead of
"IToken.getType()".
I have got metrics, it seems like it's faster by 4-4.5 times
approximately.
So we can decrease indexing time by ~2%.
At first site, ~4-5 files will be modified a little, no changes in
scanner logic itself.
****************************************************************
My question : is it reasonable for CDT 3.0.1 or 3.0.2 ?
****************************************************************
4. ArrayUtil.removeNulls() - 2.5%
5. ArrayUtil.append() - 2.1%
It seems like these functions are optimized enougth, but called too
frequently.
No propositions yet. Under investigation.
6. String.split() - 2%
This heavy method is called from several places.
************************************************************************
*********************************************************************
Calls from ScannerUtility.createReconciledPath() are eliminated by
https://bugs.eclipse.org/bugs/show_bug.cgi?id=121368
************************************************************************
*********************************************************************
Call from TranslationUnit.getElement() - this call is not significant
regarding indexing time.
...
And so on.
-----------------------------------
With best regards, Oleg Krasilnikov
Software designer, Eclipse team.
Intel corp.
+7 8312 162 444 ext. 2587
(Russia, Nizhny Novgorod)
Attachment:
Screenshot.png
Description: Screenshot.png