Framerate Drop [Solved]

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
User avatar
stampede247
Prole
Posts: 11
Joined: Thu May 02, 2013 8:21 pm
Location: United States
Contact:

Framerate Drop [Solved]

Post by stampede247 »

Hey all :)
I'm new to LOVE. And I'm kind of new to lua too (though I've done some in Minecraft ComputerCraft mod). However I have lots of experience in c# / XNA and some in c++ and a few others. Anyways so I'm not new to coding just mainly new to this field.

Anyways I started creating some simple little things in love in order to learn the system and I started noticing that I would get random framerate drops in my games :| Now I know I can use dt to regulate movement of stuff when this happens but I wanna know what's causing such a large drop.

I haven't measured how much it drops but it's noticeable to my eyes and it seems to happen randomly but around intervals of like 5-10 seconds. However in between these drops it runs completely fine (probably around 60 frames I'm guessing). I am running a windows 7 laptop with a core i7. If you need any more details about my system let me know.

Also I included one of the .love files it was happening in so you could test it. However I don't think it's my code that the problem because it doesn't do too much heavy calculations and also it happens with all .love games on my system.

Anyways thanks for the help in advance! And I look forward to working with the community! :awesome:
Attachments
BouncingBalls.love
(3.78 KiB) Downloaded 156 times
Last edited by stampede247 on Fri May 03, 2013 5:43 am, edited 1 time in total.
User avatar
Hexenhammer
Party member
Posts: 175
Joined: Sun Feb 17, 2013 8:19 am

Re: Framerate Drop

Post by Hexenhammer »

I get utterly constant 60 FPS. Strange enough, turning off vsync does not change that..

What you describe does sound like garbage collection pauses, though. Lua certainly has those.

However it seems your program produces little garbage so that shouldn't be a problem. To definitely rule out that the GC is the cause add the line..

Code: Select all

  collectgarbage("stop")
..at the end of love.load(). That turns off the GC so if the GC is the cause of the FPS drop the drop should go away. Note that this is no solution, you must collect the garbage at some point our your program will eventually run out of memory.

My other guess would be that you run some kind of program in the background which hogs the CPU / GPU every 5-10 seconds. Background virus scanners are infamous resource hogs for example. Terminate all other programs and try again.
User avatar
shatterblast
Party member
Posts: 136
Joined: Tue Dec 11, 2012 9:47 pm
Location: Dallas, Texas, USA

Re: Framerate Drop

Post by shatterblast »

My frame rate seems smooth. I don't get any slow down. This is on Ubuntu Linux.
User avatar
stampede247
Prole
Posts: 11
Joined: Thu May 02, 2013 8:21 pm
Location: United States
Contact:

Re: Framerate Drop

Post by stampede247 »

Alright thanks for the suggestions guys! I did some research, found a program to monitor what was using my gpu randomly and it turned out to be dwm. So it really had nothing to do with Love at all haha it just increased the gpu enough that the spikes would then cause lag. Anyways I got it fixed :)

NOTE: Not sure if you want me to delete this topic or set it to answered or something??
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], ncrecc, Semrush [Bot] and 4 guests