Are blank Update functions removed at compile time?

Usually when code is compiled it goes through a cleanup stage where empty things are removed and things are ordered around a little differently so that things run faster. Good examples include blank functions and unreachable code. Unity goes through some mono compiling which is a blackbox for me.

Another example of this is question is “OnCollisionStay”. If it’s blank and you have a few hundred rigidbodies it will take up significant time.

They are not removed. At least based on the information in this forum thread.

Additionally, here is a Unity blog post that details how this all works.

In particular note the following:

If a MonoBehaviour has a specific method it is added to a proper list, for example if a script has Update method defined it is added to a list of scripts which need to be updated every frame.

The post goes on to explain the performance impacts of using blank Update functions (and/or other similar Unity methods).