Should I worry about the performance of NetworkBehaviour (compared to MonoBehaviour)?

I am working on a scene that will be networked via NGO.
I am somewhat tempted to use NetworkBehaviour by default, even when there are no messages, RPCs, or NetworkVariables in it. There’s a lot of code that I wish to put in OnNetworkSpawn and OnNetworkDespawn for almost every script that I want to write. However, it does seem unnecessary; I can technically use a MonoBehaviour and just create and subscribe to events for OnNetworkSpawn and OnNetworkDespawn.

In particular I want to know if NetworkBehaviour, just by itself, results in noticeably more traffic or has a notable performance impact than MonoBehaviour, since it requires a sibling NetworkObject component.

As far as I’m aware, the only tiny hit on performance is on connection, when the object the NetworkBehaviour is on is spawned across the network. After that, as long as there is no syncing of variables or transforms or Rpc calls or the like, there should be no impact on performance.

1 Like