AnsweredAssumed Answered

Performance: Set Variable vs Calling Functions?

Question asked by CampbellSoup on Dec 5, 2011
Latest reply on Dec 5, 2011 by philmodjunk

Title

Performance: Set Variable vs Calling Functions?

Post

Hello World,

 

Please forgive me if this has been posted before, I could not find the subject here after a cursory search. I'm new to developing in FMP and was wondering if there is a significant performance difference between calling a function once to set a variable for comparison vs calling said function for each comparison instead. For example:

1. Set Variable $variable = Get(CurrentHost)

    If($variable...etc)

    ElseIf($variable...etc)

As opposed to

2. If( Get(CurrentHost)...etc)

    ElseIf( Get(CurrentHost...etc)

 

What is the tradeoff and which is considered "best practice"? Thoughts?

Thanks!

Outcomes