Love hiccups on decent computer

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
eiyukabe
Prole
Posts: 2
Joined: Tue Dec 04, 2012 11:02 pm

Love hiccups on decent computer

Post by eiyukabe »

I am working on a game with a friend and noticing some odd hiccups using the love engine on my machine (not just in our game, but in any game/example I run using Love). As an example, I get a hiccup where the program freezes for about a second when running the zoetrope demo's sprite benchmark (http://libzoetrope.org/). I can get over 2000 sprites in the sprite benchmark at 60fps, but there are those hiccups when getting there. My machine is fairly new (Intel Core i7-2600 @ 3.4GHz, 8 GB RAM) and I am running Windows 7 Home Premium 64 bit. I can run games like Skyrim fine and get these hiccups even after doing a reboot so I don't think it's performance related.

What's even more confusing is it doesn't seem to be related to garbage collection. In our game I use collectgarbage('count') every frame to show memory usage and the sharp declines (when I assume it is garbage collecting) do not line up with the hiccups. That is sometimes it hiccups and the memory keeps rising, and sometimes it hiccups and there is a drop in memory use right after the hiccup.

When I run love programs on my laptop, which is older and less powerful but also uses windows 7 64 bit, I do not see these hiccups.

Has anyone had similar issues, or does anyone have any insights?
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Love hiccups on decent computer

Post by Lafolie »

Source code! Always source code. It helps immensely, without it it's pretty hard for us to pin down the cause of the "hiccups". As a side note I'd recommended not using the collectgarbage("count") call too much, I recall reading somewhere that repeated calls can impact performance.

Also I might as well throw out the "update your drivers?" solution. It has helped in some cases.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Love hiccups on decent computer

Post by ejmr »

I am eiyukabe's friend. I just wanted to add that I do not get any hiccups or freezes like he does when running the zoetrope sprite benchmark. I am running Ubuntu 12.10, Linux 3.5.0-19-generic, with four Intel Core i3 CPU M 350 @ 2.27GH processors and 4 GB RAM. I am also using LÖVE 0.8.0 compiled to use LuaJIT.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
eiyukabe
Prole
Posts: 2
Joined: Tue Dec 04, 2012 11:02 pm

Re: Love hiccups on decent computer

Post by eiyukabe »

I'm not sure I can provide useful source code. The problem isn't just with our game, it happens with the zoetrope demo I linked (which I did not write), and it happened with another love-based game I downloaded. It seems to have something to do with things written in love on my PC (but not my laptop). I can try to write some small programs and see which ones cause it to happen and then post that if that would be useful.

Thanks for the heads up on collectgarbage("count"), I'll remove it -- just wanted to see if the hiccups happened alongside garbage collection.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Love hiccups on decent computer

Post by Lafolie »

Boolsheet informs me that I was mistaken.
<Boolsheet>Lafolie: You were probably thinking of collectgarbage("collect") when you recommended not to use "count" often. Getting the count is very fast as it just retrieves a integer.
Have you tried grabbing some stuff from Projects and Demos and seeing if they run alright? There might be a theme to problem if they do.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Love hiccups on decent computer

Post by Boolsheet »

I'd blame the graphics driver and its OpenGL implementation. I don't think this is coming from LÖVE or Lua, they're usually fast enough that it has to wait for the vertical synchronization on every frame. If it is the vsync part of the graphics driver, you could check if love.graphics.present blocks unusually long. Save every dt value passed to love.update to a file and check if they're all around 16 ms. If there's a spike every 60 frame, we know there's something fishy going on. :P
Shallow indentations.
Post Reply

Who is online

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