Given an operation such as int myNum = 5 + (5 * 9) or any other mathematical operation, what portions of this statement, if any, are performed by the compiler? Which ones are performed at runtime? Obviously, constantly changing variables cannot be simplified on compile, but certain operations might be. Does the compiler even care to do any such simplification (such as making the above statement int myNum = 50;)? Does this even matter in terms of load, speed, or any other objective measurement?
Detail is key here, please expound upon your thoughts as much as possible.
I mean this to apply to any arithmetical operation.
Check out constant folding.
Constant folding is the process of simplifying constant expressions at compile time. Terms in constant expressions are typically simple literals, such as the integer 2, but can also be variables whose values are never modified, or variables explicitly marked as constant.