cleaning up/optimizing my mod?

Is there any way I can debug/check my mods, to see if there is a way to clean them more up, optimize them, to ensure they would not lag a server??

We are using all my mods on the server, together with a bunch other, but every now and then the server lags like mad … mostly in the evenings ( peaktime? )
I want to make sure my mods is not the the reason behind the lag, so I want to clean them up, and optimize as I can.

Does it exist a command that I can use to show usage, bandwidth, cpu throttling and so on when running a mod?? I know there is a debug command, but the only time I use that is when I need to move collision and such… I don’t know if there is other debug commands that I could use for this.

I thank you all in advance for any help