Hey,
I have been experiencing this weird problem where creating a new image from an imageData object appears to have varying load times. Now that in itself is normal, but when every second image takes noticably longer to load then I become very suspicious. Take a look at the following image taken from the console (first column: imageData width*height, second column: raw data decode time (I decode a binary file into imageData using setPixel), third column: love.graphics.newImage time, all times are in milliseconds):
The only relevant information here is the last column, really. As you can see, some images take ~13 ms while others take waaay less. I can post more information if necessary.
Weird image load times
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Weird image load times
Having a look at the data would be nice, if a tile is mostly transparent (255, 255, 255, 0, I think) then that would probably take less time to generate (not sure really), also have you noticed that this may be size relevant? The taller images take more time to load (135 vs 99) Still I dont think this should be a HUGE difference as you have shown. Posting the .love that give you this results would be nice (Since now you got me really interested here hahaha)
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: Weird image load times
Might be related to https://love2d.org/wiki/PO2_Syndrome ; according to that page some images have to be reformatted by LÖVE during loading.
Re: Weird image load times
I don't think that's the issue, since none of the images are PO2-sized.S0lll0s wrote:Might be related to https://love2d.org/wiki/PO2_Syndrome ; according to that page some images have to be reformatted by LÖVE during loading.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Weird image load times
A wild guess: Since the slower images as consistently larger (even if only slightly larger) it could be that there's some cache level somewhere, where the smaller images fit and the bigger ones don't, resulting in a disproportionate difference in computation time.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: Weird image load times
Files are right here. It has the love file in it and some additional (zlib) libraries necessary to inflate some data while loading the sprite. WASD moves the camera, mouse wheel zooms in and out, arrow key left/right changes sprite facing direction, arrow key up/down changes current sequence. The images are loaded on-demand as the sprite requires it, and their decode and creation time will be displayed in the console. The function which loads the images is in exporter.lua at around line 21 (exporter.decodeImage).
If anyone could come back with further information, I would really appreciate it. Give the game a little time to load, sadly parsing that sprite file takes a good 3 seconds or so on my setup.
As for the image width and height difference, I tried enforcing a minimum size to bring them in line at some point, but same results really.
If anyone could come back with further information, I would really appreciate it. Give the game a little time to load, sadly parsing that sprite file takes a good 3 seconds or so on my setup.
As for the image width and height difference, I tried enforcing a minimum size to bring them in line at some point, but same results really.
Re: Weird image load times
I just tried it and, despite having higher numbers in the first column, the second one looks perfectly normal. Windows 7 x64.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Weird image load times
Thanks, might be a driver or hardware issue on my end then.
Who is online
Users browsing this forum: No registered users and 7 guests