Author Topic: CB perf  (Read 6855 times)

Offline grahamo

  • Multiple posting newcomer
  • *
  • Posts: 17
CB perf
« on: April 21, 2011, 08:42:32 am »
Hi,

I have to say I'm delighted with the setup... Codeblocks compiles our 30 .a's/.so's and links our exe perfectly. It runs perfectly under the debugger. Its compilation time is *five* times faster than the monolithic make system.

I've configured codeblocks to use dependencies and I've set the "Number of processes for parallel builds" to 8 (the number of CPU's on our linux server host where I compile). Our linux host is not loaded with other users.

Now I'm delighted with the setup and people are going to be delighted with the performance. However seeing as I'm a newbie I might as well ask...

Is there  any other way to speed up my build. I might naively expect codeblocks to compile 8 times faster than the monolithic make, seeing as its configured to run on 8 cpus versus the old monothreaded makefile approach.

Am I dreaming? Or is there another area I should look at to bleed another bit of performance out of CB.  FYI html logging is disabled and running from the compile line has been tested. It gives me a tiny perf improvement but I'm looking for tips from the pro's here: )

Again, nice job. Its been a while since I've used an IDE that runs as smoothly (and I've used just about all of them over the years! :)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CB perf
« Reply #1 on: April 21, 2011, 09:07:17 am »
Fastest way is to use batch build mode with all plugins (except compiler, of course) disabled. Leave the rest as you did.
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

Offline LarsPensjo

  • Single posting newcomer
  • *
  • Posts: 9
Re: CB perf
« Reply #2 on: June 16, 2012, 01:16:47 pm »
...and I've set the "Number of processes for parallel builds" to 8 (the number of CPU's on our linux server host where I compile).

I have searched a lot for this, but I can't find where you configure it?
« Last Edit: June 16, 2012, 01:25:07 pm by LarsPensjo »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CB perf
« Reply #3 on: June 16, 2012, 03:53:52 pm »
...and I've set the "Number of processes for parallel builds" to 8 (the number of CPU's on our linux server host where I compile).

I have searched a lot for this, but I can't find where you configure it?
"Settings -> Compiler ...|Compiler and debugger -> your-compiler -> Build options|Other settings"
Which part of the logical or ("|") you need, depends on the version of C::B you use.

By the way:
recent versions of make have the "-j" switch to set the number of parallel processes.

Offline LarsPensjo

  • Single posting newcomer
  • *
  • Posts: 9
Re: CB perf
« Reply #4 on: June 16, 2012, 06:47:42 pm »
...and I've set the "Number of processes for parallel builds" to 8 (the number of CPU's on our linux server host where I compile).

I have searched a lot for this, but I can't find where you configure it?
"Settings -> Compiler ...|Compiler and debugger -> your-compiler -> Build options|Other settings"
Which part of the logical or ("|") you need, depends on the version of C::B you use.

By the way:
recent versions of make have the "-j" switch to set the number of parallel processes.
Thanks! I am using version 8055, and there is no "Compiler and debugger" setting. There is one for the compiler and one for the debugger, but neither includes this option. I suppose this has been moved elsewhere?

I am running Ubuntu 12.04, with:
Code
$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: CB perf
« Reply #5 on: June 16, 2012, 08:09:57 pm »
I use svn 8055 too and the option is there.
For example for gcc compiler :
Menus Settings / Compiler ... select "GNU GCC Compiler" and in the tabs just under select "Build options" and set the "Number of processes for parallel builds" to the value you want.

gd_on
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CB perf
« Reply #6 on: June 16, 2012, 08:24:47 pm »
It is definitely there, you might click on the right arrow next to the most right tab to see it.

For the make parameters, try make --help. 3.81 is recent enough to have the "-j" switch.

Offline LarsPensjo

  • Single posting newcomer
  • *
  • Posts: 9
Re: CB perf
« Reply #7 on: June 16, 2012, 09:13:38 pm »
It is definitely there, you might click on the right arrow next to the most right tab to see it.
Found it. I don't know, I am going blind or something. Thanks!

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: CB perf
« Reply #8 on: June 18, 2012, 09:21:38 pm »
In linux you also have a -L option for make. This keeps your system under a specific load average. The advantage here is that you can specify like a max threads of 10 (with -j) for example and make will use 10 if it needs to raise the load average and then use less as the load average gets too high. this can make things compile faster in some cases, but it's main advantage is that if the system decides to do something, or you have a task scheduled cron job. make will throttle itself down to let that task continue and not cram the system full of processing tasks paralyzing it effectively making compile time much longer.

You may also want to look into the -k option, it forces the compiler to compile what it can if it encounters an error. This can be a time saver if you have an error that you later fix, this way you might not have to compile from scratch all over again.

I have a little atom processor server so I try to optimize the crap out of whatever it's doing. lol