Lowering cpu load

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
supperpiccle
Posts: 3
Joined: Sat Jan 25, 2014 12:18 am

Lowering cpu load

Post by supperpiccle »

I am running the first example in irrlicht and noticed on my quad core it uses the equvilent of a whole core(some on each core) i am using ubuntu 13.10 and was wondering if there was any way to lower the cpu load. I just think for a small app it is rediculous to use that much(i have intel core i5 4670k should rape the first example no sweat)
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Lowering cpu load

Post by thanhle »

May be use the sleep function inside the loop.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Lowering cpu load

Post by mongoose7 »

Use Vsync? Most game player's preference is for high frame rate, which implies that the CPU should not pause.

In any case, you should be able to use two cores with a properly written app. So the example is using only 50% of the expected CPU utilisation!
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Lowering cpu load

Post by hendu »

The first example uses software rendering...
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Lowering cpu load

Post by randomMesh »

Put

Code: Select all

 
device->yield();
 
in your render loop.
"Whoops..."
peeves91
Posts: 8
Joined: Wed Jul 24, 2013 2:39 pm

Re: Lowering cpu load

Post by peeves91 »

Use

Code: Select all

device->yeild()
this code just pauses the processor for a brief amount of time to let it cool down.
supperpiccle
Posts: 3
Joined: Sat Jan 25, 2014 12:18 am

Re: Lowering cpu load

Post by supperpiccle »

i tried using vsync in the createdevice function but didn't change anything...looking up documentation for it it seems as if it is only for fullscreen?
supperpiccle
Posts: 3
Joined: Sat Jan 25, 2014 12:18 am

Re: Lowering cpu load

Post by supperpiccle »

Hey i followed the indirect advice of hendu and yes software renderer must use cpu. When i changed to opengl(cause im on linux!:) ) it didn't make the cpu freak out. Thanks for the help!
SLC
Posts: 21
Joined: Mon Jan 06, 2014 9:41 pm

Re: Lowering cpu load

Post by SLC »

Also, since your game loop doesn't limit the frame rate in any way, the engine is free to update as fast as possible which can eat all the processing power :)
Post Reply