Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Performance drops for no apparent reason

Author
Message
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 23rd Apr 2017 12:25
Hello, I'm using the latest version of agk to date.

I made an app and I'm having weird performance drops. Here's how it works. It draws around 60000 120*120 non transparent sprites. Then it sets all of them invisible except for 612. Then it draws 12500 120*120 transparent sprites. Then it sets all of them invisible except for 120. There's nothing in the main loop except for the sync() and the fps counter.

I tested my code with a nexus 5x through the appgamekit app. The app starts at 55 fps and drops un 10 fps after a couple minutes, then it stays low for a couple minutes and it goes back to 50. It goes back and forth like that indefinetly. There's no change in the code that could explain such extreme FPS changes.

I thought it could be because of cpu throttling. My phone doesn't have a case and air temperature is 20°C. The phone doesn't feel excessively hot. Do you know what could be happening ? Is there a way I can check whether the cpu is throttling or not ?
programming is ace
User Banned
Posted: 23rd Apr 2017 13:00
60000 Sprites (wow)

Don't declare any create.....() functions inside the main loops... This will degrade performance

Do you have some sample code?


PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 23rd Apr 2017 14:49
With these commands
https://www.appgamekit.com/documentation/Reference/Benchmarking.htm

you might be able to find out what's happening
PSY LABS Games
Coders don't die, they just gosub without return
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 23rd Apr 2017 17:27
are they all on screen? move the invisible ones away from the screen area and also try SetSpriteActive(spr,0)
life\'s one big game
spec= 2.6ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 23rd Apr 2017 17:52
The invisible sprites are off screen. There's nothing in the main loop. Just the sync() and the fps counter. There's nothing moving in there and the fps just go up and down. I'm going to try the benchmarking functions. Thanks.
programming is ace
User Banned
Posted: 23rd Apr 2017 19:42
If there is nothing in the main loop - then it shouldn't be processing anything and should stay at a nice steady fps

Cool - let us know how you get on
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 24th Apr 2017 08:08
Hey there.

I installed aida 64 and waited for my app to sink under 10 fps and the temperature sensors showed over 50°C which is, I think, the temperature at which the nexus 5x CPU starts throttling. So good news, it doesn't come from agk. But on my end it's going to be a huge pain in the code to test.

I know the SD808 is terrible at managing temperature. How do newer phones perform in this regard ? Can I use 100% of the cpu for a couple hours or would any phone throttle after 10 minutes ?
Preben
AGK Studio Developer
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 24th Apr 2017 08:40 Edited at: 24th Apr 2017 08:41
Good news , did you try to use SetSyncRate( 30, 0 ) to give the GPU/CPU a little break, so it dont get so hot ? , also if you use SetSyncRate( ?? , 1 ) that could be your problem ?
best regards Preben Eriksen,
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 24th Apr 2017 09:06
I'm using setsyncrate( 60, 0 ) at the moment. 30 is my actual target, the problem is I won't see how my code affects performance if I set it at 30 right away. I'm going to throw A* algorythmes at it so I need to see how bad it gets in real time. Last time I was 10000 lines into my code before realizing it wouldn't work because of performance issues.

Login to post a reply

Server time is: 2024-04-19 18:14:50
Your offset time is: 2024-04-19 18:14:50