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: 
bcoding
Visitor

Re: Performance of roScreen

"JordanT92" wrote:
Hello, I'm developing my first app using roScreen the ifDraw2D components, the built-in roku search screen doesn't quite suit my needs so I'm currently designing the search screen of my app. I want this to be quick and snappy to navigate and search, I've designed the keyboard using a basic layout and below it, it will display results grapped asynchronously while you're inputting. Are there any tips I can use to increase performance as right now it seems the navigation is a tad behind and I haven't added the asynchronous search features yet. Does getting the date and time every time I draw a frame have any noticeable effect on performance?



Strangely the episode page runs faster, I guess not having to draw the alphabet of squares improves performance..?


Any tips or hints would be great!

Many thanks, Jordan.




Hi Jordan,
Hi its kind of off topic. I really like the layout of your keyboard. I am creating a custom keyboard screen which is similar to the one your created for search screen. Can you please tell me how would I create it.

Do I use roScreen, roBitmaps, roRegion? And which method did you use to draw the alphabet in the keyboard.

Thanks in advance.
0 Kudos
NewManLiving
Visitor

Re: Performance of roScreen

For one thing, make sure you create your fonts only once. Do not create them each time you draw a frame, which by the way I'm unclear about. A frame could mean several things. Be a little specific, show some code and it will help to determine where your problem is. Creating a font each time you draw something is the biggest performance hit. Using GetOneLineWidth can also be a performance hit on the low-end devices. If done properly, a keyboard is a simple structure that should have no performance problems on any device. Predefine as much of your static data as possible and keep it in an array or AA. X,Y coordinates etc. For example, the letter A will always be at a static x, y coordinate offset from the cell that it occupies since you probably will be centering it. You should not have to l_x = int( cellWidth/2 - font.GetOneLineWidth( "A", cellWidth ) / 2 ), l_y = int( cellHeight/2 - font.GetOneLineHeight() / 2 ) each time you draw A into the cell. Iterate your letters and numbers in a loop and pre-calculate and store their offsets. When your selector comes to that cell then you just have to pull the predefined offsets out of the array.
Certainly putting any number of things in what you call a frame can slow it down.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
RokuJoel
Binge Watcher

Re: Performance of roScreen

"belltown" wrote:

For some reason, Roku doesn't want you to know anything about memory usage


The architecture of the Brightscript VM doesn't lend itself to getting this information except by rather hackish methods that might cause the VM to crash and reboot the device. We would love you to have that information.

- Joel
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.