Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Romans_I_XVI
Roku Guru

OS 7.6 Update Performance Drop

Hey there, so I've been working on a game which all of a sudden started running at 40 fps rather than a consistent 60 fps for no apparent reason. It took me a while to realize that it was because my Roku updated. I realized this because I tried another Roku which hadn't recieved the update and it worked fine, until I updated that Roku as well and I was back to 40 fps.

I originally thought maybe this had something to do with the new profiler running in the background so I created a temporary private channel so the game wouldn't be side loaded, but it ran the same. I tried to narrow it down to which parts of my code were the most time consuming and couldn't find anything specific until I tried putting a timer on this one method...

timer = CreateObject("roTimespan")
m.screen.SwapBuffers()
print timer.TotalMilliseconds()


And here's what the results looked like.
 20
 6
 22
 7
 5
 22
 23
 7
 5
 22
 6
 22
 7
 21
 7
 22
 7
 22
 7
 20
 7
 21
 6
 22
 7


It's almost perfectly alternating between being ~7ms one frame and 20+ms the next.  Well 16.666ms between each frame would be 60fps so just this one call alone is taking longer than that.

Anyone have any thoughts on this? I also put a timer on my entire game loop, where all of the logic and drawing to the screen occurs, and the total for all of it is never greater than 10ms which is easily a consistent 60fps. It's the SwapBuffers() call that is killing me.
0 Kudos
21 REPLIES 21
squirreltown
Roku Guru

Re: OS 7.6 Update Performance Drop

Something changed. All my stuff is 2D API and the only way i can describe it is that it's as if roScreen is being given less CPU time. I've had to "optimize" things that worked just fine before to keep the screen from flashing. I've noticed flashing on the Home screen too.
Kinetics Screensavers
0 Kudos
NB_
Roku Guru

Re: OS 7.6 Update Performance Drop

Romans_I_XVI - what player (model#?) did you measure this on?
What do the results look like if you try on some other models?
0 Kudos
Romans_I_XVI
Roku Guru

Re: OS 7.6 Update Performance Drop

Hey there, I tried this on two Roku 3's with the same results. One is Model #4230X1 and the other is Model #4200X. I could try it on my older stick and Roku 1 lol, but those are very outdated and underpowered in the first place. I still need to buy a Roku from the newer line, I don't have any of those to test on unfortunately.

Maybe squirreltown can confirm the issue on other models beyond what I own?
0 Kudos
squirreltown
Roku Guru

Re: OS 7.6 Update Performance Drop

"Romans_I_XVI" wrote:
Maybe squirreltown can confirm the issue on other models beyond what I own?

Would love to but mine are 4200X's too. That said, the behavior was exactly the same on all 3 that I have.
Kinetics Screensavers
0 Kudos
Romans_I_XVI
Roku Guru

Re: OS 7.6 Update Performance Drop

Alright, well I might just go ahead and go buy a newer one today, I've been needing to anyway. I can give results on that later tonight.
0 Kudos
destruk
Streaming Star

Re: OS 7.6 Update Performance Drop

The profiler shouldn't be a problem unless you specifically specified it to run in the manifest.
0 Kudos
Komag
Roku Guru

Re: OS 7.6 Update Performance Drop

I'm very interested in this issue and it's resolution.

Romans_I_XVI, I'm curious about your test results - why would it have that alternating pattern usually but not always? Some of them were two short ones in a row or two long ones in a row, very odd.
0 Kudos
Romans_I_XVI
Roku Guru

Re: OS 7.6 Update Performance Drop

Yeah I thought it was very odd too Komag.

Also, I just went out and bought a new Roku Stick and although I can't compare pre 7.6 performance I can say it's not doing the weird alternating timing on the swapbuffers(). The game actually runs better on the stick, with a constant 55 FPS and the SwapBuffers() takes a consistent 15ms during gameplay. Again, I'm not sure if it would have run better pre update or not, but again I do get better performance on the stick than on the Roku 3.
0 Kudos
NB_
Roku Guru

Re: OS 7.6 Update Performance Drop

Can you guys please try the following on different players and let me know the results?
scr = createObject("roScreen", true)
tm = createObject("roTimeSpan")
delays = []
for i = 1 to 100
   tm.mark()
   scr.clear(rnd(2^31))
   scr.swapBuffers()
   delays.push(tm.totalMilliSeconds())
next
? delays

I just tried it with fw7.6.4120 on #4640 and #2500 models and it seems to return about consistent 16 (+/-1) ms, no "vibrato" like the above.

I am not saying it's not happening - rather trying to collect data on where and how.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.