Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: Poobah on March 04, 2007, 06:21:54 am

Title: Prioritising
Post by: Poobah on March 04, 2007, 06:21:54 am
On my single processor (Celeron) system, Code::Blocks uses about 25% CPU usage while compiling, leaving the rest to the compiler. This is annoying, because it gives me the impression that it could be compiling faster if Code::Blocks wasn't using the CPU so much. Another similar annoyance is that when I'm running a program just compiled with Code::Blocks, the same occurs; Code::Blocks still uses about 25% CPU, so the program runs slower than it would normally.

Could one of the developers add a feature that allows users to choose the priorities of the child compiling processes and the compiled program? It would also be helpful to be able to have an option to change Code::Blocks' priority without its child processes inheriting this priority so that, for example, Code::Blocks could be low priority while the child processes could still be normal.
Title: Re: Prioritising
Post by: Poobah on April 02, 2007, 08:52:36 am
(Bump)
Title: Re: Prioritising
Post by: Game_Ender on April 04, 2007, 12:05:53 am
Well it shouldn't be using all the CPU power at all.  Are you using a recent nightly?  There was recently a fixe with idle/update UI events that reduced CPU usage.
Title: Re: Prioritising
Post by: Poobah on April 05, 2007, 09:50:45 am
I'm using the most recent one at the moment (April 4).

The problem only occurs when there's a source file open. If I close them all, it uses 0-1% CPU. I think some of the plug-ins may be causing the trouble.

Disabling individual plug-ins makes negligible difference, but disabling all of them results in an 8-10% CPU usage decrease, leaving the usage at about 5-8%, which is still too much. (I am using what I would consider a minimal set of plug-ins, by the way:

Autosave
Code completion
Code profiler
Compiler
Debugger
Files extension handler
Scripted wizard
Windows XP Look'n'Feel)
Title: Re: Prioritising
Post by: Game_Ender on April 07, 2007, 03:55:27 am
What happens when you disable code completion?  It does have to parse the files every time you save them, so it might just still be working.
Title: Re: Prioritising
Post by: Poobah on April 07, 2007, 07:03:09 am
Disabling it makes negligible difference.
Title: Re: Prioritising
Post by: Poobah on April 18, 2007, 09:07:07 am
(Bump.)
Title: Re: Prioritising
Post by: Poobah on May 17, 2007, 04:29:17 pm
(Bump.)
Title: Re: Prioritising
Post by: Poobah on June 11, 2007, 08:00:15 am
(Bump.)
Title: Re: Prioritising
Post by: Biplab on June 11, 2007, 08:41:29 am
The compilation processes are started by wxExecute command. AFAIK, priority can't be specified in wxExecute command. :)
Title: Re: Prioritising
Post by: Poobah on June 12, 2007, 02:26:07 am
Is there any way to increase or decrease thread priorities with wxWidgets?
Title: Re: Prioritising
Post by: thomas on June 12, 2007, 10:06:15 am
There certainly is a way, but it would be an awkward solution, and it is conceptionally wrong, too. If the IDE's burns too many CPU cycles (not an apparent problem here, though), then the number of cycles spent must be reduced, not its priority adjusted.

Fiddling with priorities is generally not a good idea unless there is a good reason, as it hurts performance more often than it helps. The same is true for things like locking memory pages, purging free pages, and setting CPU affinity masks. In most cases, such "optimizations" make things worse, not better.
Nevertheless, a lot of people do it, and "memory optimizer" tools are still being sold for real money, which is beyond my comprehension...
Title: Re: Prioritising
Post by: Poobah on June 13, 2007, 03:07:28 am
Alright. Thanks for explaining the situation. :)

I'm using a 2.2GHz Intel Celeron, so I guess that's why the problem is apparent on my computer.