Improving code performance

Hi! I have one quastion about how Unity is executing the code.

For example I have such a piece of code:

void Update ()
	someAnim.speed = 2;
	someBool = true;
	someInt = 5;

and Update() is called every frame. Are these operations executed every frame or Unity understands that there is no need to set the same value to some variable many times per second?

Should I optimize this piece of code or is it done automatically?


Those operations are executed each frame. If you need it done once, do it in Start()