Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

CodeCompletion slow on some machine

<< < (2/5) > >>

ollydbg:

--- Quote from: seb_seb0 on April 12, 2012, 10:50:24 pm ---  - when I omit to normalize the path of the include directories (no call to wxFileName::Normalize in NativeParser::AddCompilerDirs), I do not get the blocking behaviour. (this can perhaps help to diagnose the cause of the problem).
  - all the time is spent in the method NativeParser::AddCompilerDirs (140 seconds on 141). Skipping this method resolves the blocking behaviour (but less includes directories are parsed, so there are less risk of blocking)

--- End quote ---

Do you mean this one in globals.cpp

--- Code: ---bool NormalizePath(wxFileName& f,const wxString& base)
{
    bool result = true;
//    if (!f.IsAbsolute())
    {
        f.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, base);
        result = f.IsOk();
    }
    return result;
}

--- End code ---


--- Quote ---Truth to be said, I am a bit lost currently, because I do not know how the plugin works. I can read the source, of course, but it takes time. Currently, I work with the last debugger nightly.

--- End quote ---
The CodeCompletion plugin wiki page may give you some hints:
http://wiki.codeblocks.org/index.php?title=Code_Completion_Design

seb_seb0:

--- Quote from: ollydbg on April 13, 2012, 03:02:54 am ---Do you mean this one in globals.cpp

--- Code: ---bool NormalizePath(wxFileName& f,const wxString& base)
{
    bool result = true;
//    if (!f.IsAbsolute())
    {
        f.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, base);
        result = f.IsOk();
    }
    return result;
}

--- End code ---

--- End quote ---

Yes, exactly. I have moved all the steps from the NativeParser::AddCompilerDirs() method into a new method Parter::AddIncludeDirFast. (steps are : macro expansion, path normalization, check directory existence, add directory to list). It made the NativeParser::AddCompilerDirs() method more readable for me.


--- Quote ---
--- Quote ---Truth to be said, I am a bit lost currently, because I do not know how the plugin works. I can read the source, of course, but it takes time. Currently, I work with the last debugger nightly.

--- End quote ---
The CodeCompletion plugin wiki page may give you some hints:
http://wiki.codeblocks.org/index.php?title=Code_Completion_Design

--- End quote ---

I have seen the wiki, but I did not have the time to read it carefully : I am a bit new regarding all parsing algorithm theory, and true understanding would take some time. I will do it in due time, but first I wanted to see if it was possible to identify an obvious bottleneck, and to correct it.

Seb

ollydbg:
I believe that you code have some encoding problems, see the log when I set the debug log output:

--- Quote ---Start : OnEditorClosed
End : 湏摅瑩牯汃獯摥. Done in 0 ms.
Start : OnEditorActivated
End : 湏摅瑩牯捁楴慶整d. Done in 0 ms.
Start : OnEditorOpen
End : 湏摅瑩牯灏湥. Done in 0 ms.
Start : OnEditorActivated
End : 湏摅瑩牯捁楴慶整d. Done in 0 ms.
Start : OnEditorActivated
End : 湏摅瑩牯捁楴慶整d. Done in 0 ms.
Start : OnWorkspaceChanged
End : 湏潗歲灳捡䍥慨杮摥. Done in 0 ms.
Start : OnProjectActivated
湏牐橯捥䅴瑣癩瑡摥㨠匠整⁰1. Done in 0 ms.
Start : NativeParser::CreateParser
慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰1Full parsing failed!. Done in 0 ms.
Start : NativeParser::DoFullParsing
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥ㄠ. Done in 0 ms.
Start : NativeParser::AddCompilerDirs
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥ㄠ. Done in 0 ms.
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥㈠. Done in 219 ms.
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥㌠. Done in 219 ms.
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥㐠. Done in 219 ms.
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥㔠. Done in 375 ms.
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥㘠. Done in 375 ms.
Start : ParseFunctionsAndFillToolbar
End : 慐獲䙥湵瑣潩獮湁䙤汩呬潯扬牡. Done in 0 ms.
Caching GCC dir: E:\code\gcc\mypcxmingw463\lib\gcc\i686-w64-mingw32\4.6.3\include\c++
Caching GCC dir: E:\code\gcc\mypcxmingw463\lib\gcc\i686-w64-mingw32\4.6.3\include\c++\i686-w64-mingw32
Caching GCC dir: E:\code\gcc\mypcxmingw463\lib\gcc\i686-w64-mingw32\4.6.3\include\c++\backward
Caching GCC dir: E:\code\gcc\mypcxmingw463\lib\gcc\i686-w64-mingw32\4.6.3\include
Caching GCC dir: E:\code\gcc\mypcxmingw463\include
Caching GCC dir: E:\code\gcc\mypcxmingw463\lib\gcc\i686-w64-mingw32\4.6.3\include-fixed
Caching GCC dir: E:\code\gcc\mypcxmingw463\i686-w64-mingw32\include
慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物⁳›瑳灥㜠. Done in 1734 ms.
End : 慎楴敶慐獲牥㨺摁䍤浯楰敬䑲物s. Done in 1734 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㈠. Done in 1734 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㌠. Done in 1859 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㐠. Done in 1859 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㔠. Done in 1859 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㘠. Done in 1859 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㜠. Done in 2359 ms.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㜠. Done in 2391 ms.
Passing list of files to batch-parser.
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㠠. Done in 2391 ms.
Header to parse with priority: 'E:\code\gcc\mypcxmingw463\lib\gcc\i686-w64-mingw32\4.6.3\include\c++\cstddef'
Header to parse with priority: 'E:\code\gcc\mypcxmingw463\i686-w64-mingw32\include\w32api.h'
Header to parse with priority: 'E:\code\cb\cb_debugger_branch\src\include\sdk.h'
Add 3 priority parsing file(s) for project 'Code::Blocks wx2.8.x'...
慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›瑳灥㤠. Done in 2391 ms.
Added 816 file(s) for project 'Code::Blocks wx2.8.x' to batch-parser...
End : 慎楴敶慐獲牥㨺潄畆汬慐獲湩g慎楴敶慐獲牥㨺潄畆汬慐獲湩⁧›潮瀠牡敳rNativeParser::DoFullParsing(). Done in 2391 ms.
慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰2慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰3慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰4*NONE*. Done in 2391 ms.
慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰3慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰4*NONE*. Done in 2422 ms.
慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰4*NONE*. Done in 2422 ms.
Create new parser for project 'Code::Blocks wx2.8.x'
慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰5慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰6Parser does not exist for delete '%s'!. Done in 2422 ms.
慎楴敶慐獲牥㨺牃慥整慐獲牥㨠猠整⁰6Parser does not exist for delete '%s'!. Done in 2422 ms.
湏牐橯捥䅴瑣癩瑡摥㨠匠整⁰2湏牐橯捥䅴瑣癩瑡摥㨠匠整⁰3. Done in 2422 ms.
湏牐橯捥䅴瑣癩瑡摥㨠匠整⁰3. Done in 2422 ms.
End : 湏牐橯捥䅴瑣癩瑡摥伀偮潲敪瑣捁楴慶整⁤›瑓灥ㄠ. Done in 2422 ms.
Updating class browser...
Class browser updated.
Starting batch parsing for project 'Code::Blocks wx2.8.x'...
Start : OnParserStart
End : 湏慐獲牥瑓牡tOnParserEnd. Done in 0 ms.
Project 'Code::Blocks wx2.8.x' parsing stage done!
Project 'Code::Blocks wx2.8.x' parsing stage done (1079 total parsed files, 84540 tokens in 0 minute(s), 58.641 seconds).
Start : OnParserEnd
End : 湏慐獲牥湅d. Done in 0 ms.
Updating class browser...
Start : ParseFunctionsAndFillToolbar
End : 慐獲䙥湵瑣潩獮湁䙤汩呬潯扬牡. Done in 15 ms.
Class browser updated.
Start : OnEditorActivated
End : 湏摅瑩牯捁楴慶整d. Done in 0 ms.
Start : OnEditorActivatedTimer
湏摅瑩牯捁楴慶整呤浩牥搠潮桴湩g. Done in 0 ms.

--- End quote ---
I'm using WinXP (my local language is Chinese), So I think the _T() is need like:

--- Code: ---CC_TRACE_FILE_END(_T("CodeComplete"));

--- End code ---
right?

ollydbg:
Look:

--- Code: ---#define CC_TRACE_LOG_START(x)                                               \
        wxString sStart(_T("Start : "));                                        \
        sStart += _T(x);                                                        \
        CCLogger::Get()->DebugLog(sStart);                                      \
        std::ofstream os("debug_cc.txt",                                        \
                         std::ios_base::app | std::ios_base::out);              \
        os << "Start : " << x << std::endl;

--- End code ---
So, _T(x) is here.


--- Code: ---#define CC_TRACE_LOG_END(x, y)                                              \
        wxString sEnd;                                                          \
        sEnd.Printf(_T("End : %s. Done in %d ms."),x, y);                       \
        CCLogger::Get()->DebugLog(sEnd);                                        \
        os << "End : " << x << " done in " << y << " ms."  << std::endl;

--- End code ---
It should be:

--- Code: ---sEnd.Printf(_T("End : %s. Done in %d ms."),_T(x), y);

--- End code ---

ollydbg:
BTW: How can I test it, I have apply your patch, and I just use the c::b to open codeblocks.cbp, I can't see difference in the time when CC parsing stage done.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version