CPU Usage in Demo Projects?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
LaggyNewbie
Prole
Posts: 6
Joined: Sun Oct 11, 2009 1:53 am

CPU Usage in Demo Projects?

Post 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?
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: CPU Usage in Demo Projects?

Post 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).
LaggyNewbie
Prole
Posts: 6
Joined: Sun Oct 11, 2009 1:53 am

Re: CPU Usage in Demo Projects?

Post by LaggyNewbie »

Yes, I am running 2 cores. Good thinking.

Seems to have dropped CPU down to 15%.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: CPU Usage in Demo Projects?

Post 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.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: CPU Usage in Demo Projects?

Post 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?
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 29 guests