I suggest you pay a decent consultant an 1-3 hours to teach you the basics.
there's a lot of nuances. This is what I did when I started, and it saved me weeks of effort. There's too many nuances/unexpected behaviours, so if you're doing this professionaly; get some proper advice. The O notation of aa's is about the least of your worries - there's at least 10 other things I can think of which could necessitate a complete redesign of your architecture if you don't know about them: so get some help!
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook
Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework