Page 1 of 1

CPU Usage in Demo Projects?

Posted: Sun Oct 11, 2009 1:58 am
by LaggyNewbie
Running a high end machine and taking a look at Love demo projects:

lovalanche: Essentially 0% CPU usage, uses GPU I assume, Good!
no: Essentially math.. no difficult animation.. click detection.. 50% CPU usage!! Very Bad
particles: uses GPU, very basic input detection... 50% CPU usage again, Very Bad


What is the story? Is checking for input causing 50% CPU usage on a high end machine?

Re: CPU Usage in Demo Projects?

Posted: Sun Oct 11, 2009 3:03 am
by TechnoCat
I'm assuming it just amounts to the examples not including love.timer.sleep(10).

Would you happen to have a dual core computer? That might explain the 50% (completely taking up one of your cores).

Re: CPU Usage in Demo Projects?

Posted: Sun Oct 11, 2009 3:26 am
by LaggyNewbie
Yes, I am running 2 cores. Good thinking.

Seems to have dropped CPU down to 15%.

Re: CPU Usage in Demo Projects?

Posted: Sun Oct 11, 2009 5:30 am
by TechnoCat
love.timer.sleep( ms )
0.5.0 Documentation wrote: Delays execution for the specified amount of milliseconds. Tragically, the precision varies from system to system, and is generally not very good. Do not expect to get better precision than the nearest 10ms.

Re: CPU Usage in Demo Projects?

Posted: Sun Oct 11, 2009 7:56 am
by rude
LÖVE will take all the CPU it can get (unless told otherwise with love.timer.sleep). Lovalanche should also use 50%, and I find it very odd that it's essentially zero. Could you have misread?