Hi everyone!
I guess this question is directed primarily to AlphaMonkeyC, but maybe someone else can shed some light too?
Quite simply, I was wondering how clever the MonkeyC compiler is?
I've been writing a bit of code while playing around with Connect IQ, and in doing that I've wondered, where a simple operation is needed for which there is no method available in the Connect IQ SDK and that is called repetitively in a loop, whether I should call my own function that implements this operation, or if rather I should repeat the implementation in my loop, from a performance perspective.
In other words: is the compiler clever enough to do function inlining?
Furthermore, there are some other things I would like to know concerning compiler intelligence & performance.
E.g.: does the compiler use tricks like bit shifts for instance? Or can we devs gain substantial profit by coding a multiplication * 2 as var twenty = 10<<1 instead of var twenty = 10*2?
Thanks!