Acknowledged
CIQQA-3312

Bug: Profiler Inconsistency

I'm currently working on performance optimizations using the Connect IQ profilers, but I'm encountering highly inconsistent results. In several cases, extremely simple functions appear to take disproportionately long to execute, according to the profiler output.

A particularly clear example of this issue is shown in the code sample I'll post in the comments: two nearly identical functions are profiled, yet their reported execution times differ significantly.

I previously reported a potentially related issue regarding mislabeled profiler entries:
 Link https://forums.garmin.com/developer/connect-iq/i/bug-reports/incorrect-background-registerforsleepevent-entries-in-profiler

It seems possible that something similar is happening here—perhaps another function is being incorrectly labeled as getValueColor, leading to misleading results.

  • Unfortunately, I didn’t tag the version of the code where this issue occurred. Since then, I’ve made several changes and can no longer reproduce the problem—neither with the current version nor by going back a few commits from around that time.

    While reviewing the current code, I noticed something unusual: according to the profiler, System.println triggers a long call to Media.stopPlayback. I don’t recall seeing that before, though I usually run profiling and optimization with debug log statements disabled. It seems unlikely that System.println would directly cause such a call—could there be an explanation for this?


  • What happens when you change the method names?

  • Both of these functions are nearly identical:

    public function getLabelColor() as ColorType? { return _labelColor; }
    public function getValueColor() as ColorType? { return _valueColor; }