I have checked the current performance of indexing C++ project and it is still very slow for initial scan.
I will investigate the reason, if you'd like
Well, it's again the very expensive creation of useless snapshots.
I will attach the patch which speeds up initial indexing 3x times
Created attachment 84934 [details]
the idea is to get mime-type info somewhere else, not by expensive creating of snapshot
with the proposed change time is improved from
Complete indexing of 3 source roots took: 149192 ms
Complete indexing of 3 source roots took: 43312 ms
It looks like this issue is already fixed in trunk. Can you check it? Or do you want to fix it in some other branch?
Vita have changed files crawling and closed issue 166340 with the request to open new one if we find the problem again.
I have checked the influence of fixes of issue 166340 and found that initial scanning phase is still very very slow (as
you can see 150 sec :-( ).
I have checked it in trunk version of cnd-main repository => I have profiled the problematic scanning and found that
fixing issue 166340 introduced creation of non-used snapshot (very expensive) for the only reason of detecting
mime-type => I have changed it in the proposed patch.
Btw, I have checked your trunk as well
and I see that the issue exists (see line 1303).
So, I have checked it :-)
Yes, but last Vita's change fo RepositoryUpdater is opposite to your patch:
So, I am confused. I will reassign this issue to Vita. He should be back soon.
Oh, I see. That explains, why before Vita's optimization I have seen 3x speed up and after the fix initial scan became
slow again. So, as result the improvement was only with "up-to-date" check and nothing was changed in initial scan phase
Integrated into 'main-golden', will be available in build *200907230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Vladimir Voskresensky <email@example.com>
Log: fix for IZ#168817: slow indexing of C++ project
- do not create snapshots to obtain mime-type information only
Unfortunately, Vladimir's http://hg.netbeans.org/main-golden/rev/59600af3ff86 is not correct. The mime type has to be
taken from the snapshot otherwise indexing is not going to work in embedded scenarios. I'll have a closer look and try
to come up with a correct solution that would improve situation for cnd. In the meantime I'm going to backout 59600af3ff86.
Oh, I've now seen http://hg.netbeans.org/main-golden/rev/b4073f9088e6, which reverts 59600af3ff86. Thanks Vladimir
Vita, thanks for the evaluation. I expected that it might be incorrect in general case...
Can we enhance ResultIterator with getMimeType to prevent creating of snapshost only for getting mime type?
This should fix the problem - http://hg.netbeans.org/jet-main/rev/c633b15a60d9 - even though I was not able to see 3x
improvement reported by Vladimir. I generally seem to be getting much higher numbers than Vladimir. Vladimir, could you
please remeasure this again and either confirm the fix or reopen this issue? Thanks
Ok. I will check tomorrow (and profile further if needed).
Btw, do you know that you can turn off parsing part of C++ project (and leave only scanning phase) in project's context
menu Code Assistance->C/C++ Code Assistance
Integrated into 'main-golden', will be available in build *200907240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Vita Stejskal <firstname.lastname@example.org>
Log: #168817: do not attempt to parse snapshots of files that have no EmbeddingIndexer
"Btw, do you know that you can turn off parsing part of C++ project" - Neat, thanks. Now I know :-).
Complete indexing of 3 source roots took: 43223 ms
I see the speedup, thanks!