Author Topic: C::B - big CPU usage  (Read 4943 times)

Offline zingiel

  • Single posting newcomer
  • *
  • Posts: 8
C::B - big CPU usage
« 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

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: C::B - big CPU usage
« Reply #1 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B - big CPU usage
« Reply #2 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

arst

  • Guest
Re: C::B - big CPU usage
« Reply #3 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]

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: C::B - big CPU usage
« Reply #4 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.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: C::B - big CPU usage
« Reply #5 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.