1. I notice a lot of plugins use these. Even though they execute code only if certain state is true (if (test != null)), will they still affect performance to the point where you can see loss of server frames?

    Let's say you have 3 plugins using OnPlayerInput with 300 server fps and 100 players online. The code (if (test != null)) is run even if player stand still and no buttons pressed, correct? So 3*300*100 = 90 000 checks per second, seems a lot but maybe it doesn't matter?

    I'm just getting into C# oxide so I'm very curious about what to look out for that may affect performance in bad ways. Any tips and advice greatly appreciated.
     
  2. Wulf

    Wulf Community Admin

    Yes, it's a resource intensive hook that is called frequently. It is very likely to affect your server performance.
     
  3. I can give an advice, use Unsubscribe() to unsubscribe a hook that not needed anymore.
    Also, try to replace intensive hooks with your own solutions, like you said Update() from MonoBehaviour.