Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mark1977 on October 09, 2012, 11:49:37 am

Title: CB-launched code runs slower than command-line launched code
Post by: mark1977 on October 09, 2012, 11:49:37 am
Hi,

I am using CB svn rev 7953 on Ubuntu 32bit Linux. When I compile my code through CB it creates the executable. If I launch that executable through CB (in xterm or gnome-terminal) then it runs slower (about 383ms per timestep) than if I go to the command line and execute it directly in the shell (about 225ms per timestep).

Anybody know why this would happen?

Thanks

Mark

p.s. This is c++ code with intel compiler.
Title: Re: CB-launched code runs slower than command-line launched code
Post by: oBFusCATed on October 09, 2012, 12:24:57 pm
Do you use the same terminal emulator?
Title: Re: CB-launched code runs slower than command-line launched code
Post by: mark1977 on October 09, 2012, 12:46:45 pm
Yes. Though it happens whatever terminal I use.
Title: Re: CB-launched code runs slower than command-line launched code
Post by: oBFusCATed on October 09, 2012, 01:00:20 pm
How many cores do you have on the machine?
Is you application using all the cores?
If yes, then your app and C::B battle for CPU usage, as C::B is using some CPU to wait for the console.
Title: Re: CB-launched code runs slower than command-line launched code
Post by: mark1977 on October 09, 2012, 02:58:03 pm
How many cores do you have on the machine?
Is you application using all the cores?
If yes, then your app and C::B battle for CPU usage, as C::B is using some CPU to wait for the console.

I have 4 cores, one thread per core. I run on only one core.