Community
Participate
Working Groups
Build Identifier: M20100211-1343 When using CDT to browse a 40,000 line C++ file, I noticed that clicking on the constructor (specifically the id after the ::) kicks off a long-running worker thread to find other occurrences of the id in the file (for the Mark Occurrencs feature). This operation locks the AST and takes 15 minutes to complete. Here is the partial stack trace of the worker thread while running: ... org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getImplicitReferences(CPPVisitor.java:1850) org.eclipse.cdt.internal.ui.search.OccurrencesFinder.performSearch(OccurrencesFinder.java:75) org.eclipse.cdt.internal.ui.search.OccurrencesFinder.getOccurrences(OccurrencesFinder.java:103) org.eclipse.cdt.internal.ui.editor.CEditor.updateOccurrenceAnnotations(CEditor.java:3261) org.eclipse.cdt.internal.ui.editor.CEditor$7.selectionChanged(CEditor.java:3287) ... Would it be possible to have the search for implicit references also turned off in this case when the semantic highlighting of overloaded operators is turned off? Reproducible: Always
Created attachment 170305 [details] Short term fix This patch disables mark occurrences for overloaded operators if semantic highlighting for overloaded operators is disabled (which is the default). This is just a short term fix, because this should rather become a separate preference option for the mark occurrences feature.
Committed to HEAD. I have opened bug 314813 to add a separate preference option.
*** cdt cvs genie on behalf of aleherbau *** Bug 314635 - Marking occurrences is very slow on a large file due to searching for implicitReferences (interim fix) [*] OccurrencesFinder.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OccurrencesFinder.java?root=Tools_Project&r1=1.6&r2=1.7 [*] CEditor.java 1.211 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java?root=Tools_Project&r1=1.210&r2=1.211 [*] MarkOccurrenceTest.java 1.11 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java?root=Tools_Project&r1=1.10&r2=1.11
We are using Kepler SR2 (CDT 8.3.0). Mark occurrences is slow(1 to 3 minutes)for the large files in the below scenarios: 1. While modifying a large file and if we try to mark occurrences, it is taking 1 to 3 minutes to highlight all the occurrences. If my next action is marking other word, then it is very fast.(My successive markings are fast until I modify or type something). If I type anything, again it repeats 1 to 3 min lag. 2. When we switch from one source file to another, Marking occurrences on the variables are taking longer times to highlight the variables.My successive markings are fast until I switch to another file and back to large file. Both the above scenarios can be consistently reproducible. If needed, could you please open a new ticket for CDT 8.3.0 Thanks