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

Performance of function expressions vs statements

Are there any performance gains/losses in using function expressions vs statements? In JS there's recently been a push towards using statements as it avoids hoisting and makes the code more semantic, eg not executing a function before it's declared. There's also a handy perf test: http://jsperf.com/fn-expression-vs-statement but the performance difference on modern browser isn't much.

How about on Roku boxes? Is it more performant to use:

sub Main()
print "I can haz app"
end


Or

Main = function()
print "I can haz app"
end


Otherwise are there any benchmark tools available to allow me to performance test these boxes?
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.