Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Performance improvements related to console logs

Someone reached out to me directly asking the following question.  Does anyone have some thoughts on this?

Would you or one of the developer colleagues be able to help answer a few questions in order to understand how console.log messages are working so I can improve my apps and clocks the best way possible - here goes.

1) if you install an app on the watch or simulator from CLI, console messages appear on the console when running
2) if you connect a watch with an app [with console.log messages] loaded from the Gallery they do not appear on the console.

At what point are they removed from the FBA,

1) when the app is sent to be published?
2) when the app is downloaded from the gallery?
3) or is the app flagged as not having a console, but the instructions are there and ignored?

I am asking for optimising and performance reasons, both for making clocks or apps load on the watch from the Gallery faster and reduce the size of the image to load to be more performant.

If for example the app is recompiled during the Gallery load phase it can slow the process or even create errors.

If they are removed during the publication step, it can reduce the size of the program to eventually load to the watch and thereby speed up loading or even create errors.

How the console.log instructions are ignored is important, for example

if (SwitchedOn) start=true; else console.log("Not switched on');
A=1;
B=2;

In this example, if the console.log message is removed then A=1; will only be executed if !SwitchedOn whereas it should always be executed for either value with the console.log message present.

So you see why it is important to know where and how they are processed to improve loading, performance and ensuring correct execution.

Thanks!

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes
0 REPLIES 0