I am just wondering what is the cost of doing data field calculation I compute() for values which may or may not be used?
Eg: calculating normalized power when normalized power is not one of the desired fields to be displayed by the user.
I am just wondering what is the cost of doing data field calculation I compute() for values which may or may not be used?
Eg: calculating normalized power when normalized power is not one of the desired fields to be displayed by the user.
for all the things in compute it'll be the same cost when the data field is shown or not shown.
if you know that you don't need te data why do you calculate it? surely you could add an if in your…
For any thing, it's best not to run code if the result isn't needed.
The thing to consider is if it "might" needed if the user changes what is displayed while the DF is running. For example…
for all the things in compute it'll be the same cost when the data field is shown or not shown.
if you know that you don't need te data why do you calculate it? surely you could add an if in your compute no?
For any thing, it's best not to run code if the result isn't needed.
The thing to consider is if it "might" needed if the user changes what is displayed while the DF is running. For example, if you had the option to display a graph of this data since the activity started, you might not need what's done unless the user decides to change what's displayed. You could of course not allow the user what's displayed while the DF is running (only read app settings during initialize() for example)
Thanks peterdedecker and jim_m_58 for the answers. I do agree that if it's not needed, then don't calculate it, it costs CPU cycles (eg: Normalised Power when the user doesn't request for Normalised Power as one of the fields or Lap Pace or Lap Speed or etc)
However, like what Jim mentioned, the issue is when the user changes the display from Screen 1 to Screen 2 to look at something else before going back to screen 1. In those say 10secs, my understanding is unless it is in compute, the data won't be calculated or made available etc. So therein lies the situation.