why retina so slow

Previous topic - Next topic

djtoon

on regular screen size  480x320 im at 32+ fps
and  on retina i get 9

any workaround or someting?

erico

I will try the ´something´... :S

Since retina is pushing 4x more pixels around, it does make sense it gets a 9fps against 32+ (36?)?
So here is a guess:

Suppose the problem is not related to how gfx goes about, like you can do a simple few move big sprites on retina and it sustains good speed, let´s suppose then that your code is doing a lot of complex stuff and that is taking time.

I once heard you could improve code speed by not doing everything every cycle but dividing it in a set of cycles, let´s suppose 10 cycles, and then you could calculate some of the more not-needed-computations every 2 cycles or even more, for example, collision detection.

I´m not sure this helps at all, and I suspect you are already doing something like this.
But it is the only ´something´ that comes to my mind ;)


djtoon

10x
well ... ill try some more tricks but i guess ill give up on retina for this one if i cant get the fps i need

Wampus

You shouldn't be seeing a speed drop like that. The retina screen is much higher resolution but the gpu should handle it. Whatever your app is doing it sounds like scaling up is exponentially increasing demand on the gpu. Odd.

BdR

Have you tried the profiler? It's in the GLB menu, select Compiler -> Profiler -> Active and then run your GLB program on Windows. Then do some default things like play one round or whatever. It will write a file called profile.csv. Take a look at it and see which functions or subs are used the most. Maybe there are some that take a lot of time on average, you could try to optimize those.

Things that typically take too much time are float to int conversions (mixing ints and floats, example fVal1# = fVal2# / i%), cos/sin stuff, drawing lots of small particles sprites etc. These are small things, but they really add up if you do a lot of these inside your inner-most game loop.

Wampus

Wow BdR I'm such an idiot. I didn't know about the Profiler so I wrote code in my new apps to measure time taken in ms for each function when running in debug mode which is then output to a log file. I seem to have this habit of reinventing the wheel.

BdR

#6
Yeah reinventing the wheel, I know what you mean I do that a lot too :D

btw about the profiler; all times are shown with 3 decimals (a thousand of second), is it possible somehow to get more decimals digits? My app is divided in lots of functions and most of them take 0 seconds to exec, for both the "Exec,only[ s]" and "Av,Exe[s/call]" columns. Or perhaps is it possible to use the GLB profiler when running the iPhone app?

erico

I didn´t know about that either BdR, thanks! :good:

djtoon

im useing cos and sin animation : like xpos=xpos+sin(gettimerall()/8)*5

is there more way's? to do that?
10x

Kitty Hello

In Samples/COMMON, there's a qmath.gbas file that has qsin, qcos. They are not that accurate, but much faster.

kanonet

The QSIN in /samples/common is a bit outdated, a newer and way faster version is here: http://www.glbasic.com/forum/index.php?topic=6446.msg65027#msg65027
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64