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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Binge Watcher

Delayed app by calling component interface

If I have a component and call their-own interface field or function it make a small delay like 16ms, I know it looks small but if you call several times or often it kinda big.

So let imagine you have your own component like this (myawsomecomponent.xml😞
<?xml version="1.0" encoding="utf-8" ?>

<component name="myawsomecomponent" extends="Group">

     <field id="first" type="string" />

  <script type="text/brightscript" uri="pkg:/components/myawsomecomponent.brs" />


and code is doing something like this (myawsomecomponent.brs😞
sub init()"first", "get_first")
end sub

' SLOW - accessing into it take 16ms '
function latelyCalledFunction() as void
end function

' improved performance - accessing into m it take 0ms '
function latelyCalledFunctionEnhanced() as void
  print m.first
end function

function get_first(event as object) as void
  m.first = event.getData()
end function

Same is if I use callFunc to execute function field.

In this case I am able to improve speed but still if I want send some data from component into component it took 16ms per each. Is there some performance effectively way to pass data from component to component?

I hope I can somehow use roMessagePort but not sure how could do that.
Platforms integration specialist
0 Kudos
Binge Watcher

Re: Delayed app by calling component interface

Poster working well in this case ...

Even I think it is more hack than solution I solved it by changing parent of my component which were extended from a Group, now is extended from a Poster and there is no delay.
Platforms integration specialist
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.