I'm trying to chase a momentary performance drop issue on a Raspberry Pi project I'm developing on Windows with LÖVE 11.2. On Windows, I noticed that after 30-40 seconds, FPS drop noticeably (from 60 to 54, sometimes 20 or 30 something). I get 500fps with vsync disabled, so I thought it should be something I'm doing wrong on the update or draw functions after the first 30 seconds.
As I found nothing, I started removing code chunks. I've reached to the point that almost nothing is done (initialize a global variable in love.load, and drawing some stats on love.draw). Here's the code:
Code: Select all
--*****************************************************************
-- MAIN LOVE FUNCTIONS
--*****************************************************************
lf = love.filesystem
la = love.audio
li = love.image
lg = love.graphics
lj = love.joystick
lm = love.mouse
lg.setDefaultFilter( "nearest", "nearest" )
-----------------------------------------
-- love.load
-----------------------------------------
function love.load(arg)
gStartTime = love.timer.getTime()
end
-----------------------------------------
-- love.update
-----------------------------------------
function love.update( dt )
end
-----------------------------------------
-- love.draw
-----------------------------------------
function love.draw()
local text = "FPS: " .. love.timer.getFPS() .. " | FRAMETIME: " .. string.format("%.5f", love.timer.getAverageDelta() )
lg.print(text, 5, 5)
local stats = lg.getStats()
lg.print("DRAWCALLS: " .. stats.drawcalls, 5, 30)
lg.print("DRAWCALLSBATCHED: " .. stats.drawcallsbatched, 5, 55)
lg.print("IMAGES: " .. stats.images, 5, 80)
lg.print("TIME: " .. (love.timer.getTime() - gStartTime), 5, 105)
if (love.timer.getFPS() < 60 and (love.timer.getTime() - gStartTime) > 5) then
print ("TIME: " .. (love.timer.getTime() - gStartTime) .. "; FPS: " .. love.timer.getFPS())
end
end
I'm attaching the .love (nearly empty main.lua and conf.lua files, actually) if you don't mind running it for a minute. As I said, it only makes sense that my machine is the problem, but I would like to confirm before figuring out another cause of the sudden performance drop