General Compiler question about efficiency

If I have say a property assignment which goes through several function callssuch as

MyLocalVariable->GetAF()->GetB()->GetC()->SetHealth (Health/100.0f);

When I compile this, is the comiler smart enough just to grab the end method, or does it really put into code all these intermediate method calls?

In such a case, for methods that I am repeatedly calling like this say on Tick, It will be much more efficient to cache a local pointer of the final method or property I am writing too. ???

Hope that makes sense, Thanks

Yeah, it needs to know each of those pointers at run-time, the compiler can’t optimize them out.

Caching the variables will probably be the faster… That’s what Animation Blueprints usually do - you set the cached versions in the ABP once a frame and then the animation nodes use those…

Thnks, I guess I got me some optimizing to do!