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: 
EnTerr
Roku Guru

Re: Utility functions in Scene Graph SDK

"Tyler Smith" wrote:
What is the impact of multiple components including the same utils file over and over.
We have a rowlist that has over 100 items in it that each include the utils. Is this going to kill the UI thread over time?

That is a great question!
Theoretically if done well, there should be practically no impact (B/S functions are constant/literals, they carry no lexical context with them so can take memory only once and be shared between all components/threads/interpreters; the price could be as low as dictionary entry name: *fnBody). In practice i suspect they are duplicated...

Hey, you are in good position to test that - why don't you? Spin lots and lots instances of the same component until the player crashes, periodically print to console so you can see approx. how many instances it took to run out of memory. Do the same experiment WITH and WITHOUT including some massive B/S utility library in that component. And let's take a gander at the two numbers. Chances are, we'll learn something...
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!