Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: zingiel on February 10, 2007, 11:36:24 pm

Title: C::B - big CPU usage
Post by: zingiel on February 10, 2007, 11:36:24 pm
Hi,
why C::B uses processor very much, when it is not compiling and not linking?
What does C::B does? It uses 15..30% CPU, sometimes 50%, when I'm doing nothing in C::B.
I'm checking it in 'Process Explorer'...
Maybe some option in environment?

Regards
Title: Re: C::B - big CPU usage
Post by: Game_Ender on February 11, 2007, 02:15:46 am
That is due to misuse/overuse of internal UI state update events.  So it basically boils down to a bug in CB.  Since CB is still in the "early" developement stages I don't think the CB team if focusing on optimization right now.  I am sure they would like patches to improve performance.
Title: Re: C::B - big CPU usage
Post by: MortenMacFly on February 11, 2007, 02:13:38 pm
Personally I don't see such hight processor load except when I open a project. But this is as expected as then the CC plugin start to do it's batch parsing. Once this is finished the processor usage is back to "normal" (nearly nothing) again. Could it be that this high processor load is nothing but the CC plugin for you, too?
With regards, Morten.
Title: Re: C::B - big CPU usage
Post by: arst on February 11, 2007, 04:07:19 pm
Yes, CB takes a lot of CPU on my machine (1GHz laptop).

Attached is snapshot from task-manager. CB has used 10%
CPU power almost continously, while not being used for much
of the time.

This is also with Code completion disabled.

With many laptop, the fan spins up even at modest loads, so
with CB running my fan is on for much of the time. And I do
enjoy quiet computing...

Would be interesting with some profiling to see where the
time is used.

Regards
Arst

[attachment deleted by admin]
Title: Re: C::B - big CPU usage
Post by: Der Meister on February 12, 2007, 12:42:34 pm
That is due to misuse/overuse of internal UI state update events.  So it basically boils down to a bug in CB.
As far as I know thomas once removed these events to check this. And if I remember correctly this did not change anything. The CPU usage was quite the same.

Anyway, this problem seems to appear not on every machine running Code::Blocks, thus it is probably an issue with some library (directly or indirectly) used by Code::Blocks. And I remember a quit long thread here in the forums with a discussion about this problem on Ubuntu.
Title: Re: C::B - big CPU usage
Post by: Game_Ender on February 12, 2007, 07:13:33 pm
Different problem I think.  This is CB using lots of CPU when you are just moving the mouse around.  Something has to be trigering events if moving the mouse causes the CPU usage to spike.  It has to be either wxFlatNotebook, wxScintialla, wxAUI, or CB itself.  The Ubuntu issue was that the CB's performance while typing was quite slow.  I managed to track some of the CPU usage down to pango calls, but I couldn't figure it how/why they were being called.