Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
cc-branch crashes on linux
Loaden:
--- Quote from: oBFusCATed on August 24, 2010, 02:23:29 pm ---Why the number of parsed files is less that the trunk version 1250 vs 1531?
--- End quote ---
Because there are many parsed header files is wrong!
--- Code: ---#if 0
#include <a.h>
#include <b.h>
#include <c.h>
#include <d.h>
#include <e.h>
#else
#include <f.h>
#endif
--- End code ---
In trunk(or 10.05), cc will parse the #if condition preprocessor:
#if 0
#include <a.h>
...
But in cc branch, will parse the #else condition preprocessor:
#else
#include <f.h>
Loaden:
--- Quote from: Loaden on August 24, 2010, 02:10:27 pm ---
--- Quote from: jens on August 24, 2010, 11:04:17 am ---It's at least much slower.
--- End quote ---
Here is the test log on linux.
--- Quote ---10.05:
Parsing stage done (1531 total parsed files, 58540 tokens in 0 minute(s), 7.808 seconds).
CC branch -O0
Project 'Code::Blocks - Unix' parsing stage done (1250 total parsed files, 64146 tokens in 0 minute(s), 14.026 seconds).
CC branch -O2
Project 'Code::Blocks - Unix' parsing stage done (1250 total parsed files, 64147 tokens in 0 minute(s), 12.685 seconds).
--- End quote ---
We can see that, cc branch get more tokens, and handle more, like condition preprocessor handle, function-like macro handle...e.g.
You can open the "-O2" option, can make cc faster.
--- End quote ---
Another reason: In current cc branch, we need get system headers list in another thread.
So, It's need some time.
When i open the CB project again, it's make faster.
--- Quote ---Project 'Code::Blocks - Unix' parsing stage done (1250 total parsed files, 64147 tokens in 0 minute(s), 6.390 seconds).
--- End quote ---
Loaden:
--- Quote from: Loaden on August 24, 2010, 02:21:54 pm ---
--- Quote from: killerbot on August 24, 2010, 11:00:14 am ---Hopefully this can be fixed.
EDIT : I found a way to reproduce this in my working environment (didn't try with a small project).
So I have a workspace with several projects, some files of these projects are open. I drag and drop a cpp file to CB (this file doesn't belong to any of the projects). CB shows the file.
Then I select the tab of one of those other open files (which are part of the project). All still is ok, then I select the tab of the "open non project file" --> crash.
EDIT 2 : tried this with a small project (generated by CB), and same recipe as in the EDIT above.
--- End quote ---
I will fix it.
--- End quote ---
Fixed!
ollydbg:
--- Quote from: jens on August 24, 2010, 11:04:17 am ---It's at least much slower.
--- End quote ---
compared with which?
As loaden said:
The conditional preprocessor and macro expansion takes a lot of time, also make cc get more precise tokens.
ollydbg:
Btw:
About the performance issue, I have discussed with loaden, currently, we can't use "multi-thread" of parserthread, because wxString is not thread-safe. so you can see, the memory pool is force to run only one thread.
--- Code: ---Parser::Parser(wxEvtHandler* parent) :
m_pParent(parent),
m_UsingCache(false),
m_Pool(this, wxNewId(), 1), // in the meanwhile it'll have to be forced to 1
--- End code ---
So, this way, CC can only run on a single CPU, my experience is my dualcore CPU is under only 50% usage when CC do a batch parsing.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version