General Performance Question

Hey guys just wanting to get some info about some small things that may or may not be impacting performances for a game. First off i was wondering it it was more effective to call functions to execute code than to just put the code in the the update function. Pesudo* Code example

void Update()
{
 If (true)
 {
   if (this)
    //Do something
   if (this)
    //Do something
   if (this)
    //Do something
 }
}

as opposed to

void Update()
{
if (true)
 ExecFunc();
}

void ExecFunc()
{
if (this)
        //Do something
       if (this)
        //Do something
       if (this)
        //Do something
}

Also i was wondering if and when a class is too large, example a class with over 600 lines of code, would it be more effiecient to split it into 2 300 line scripts or is it just personal preference, also any general tips for c# programming optimization will be greatly appreciated =D

Get your code working first, then optimize later if needed. Make code as simple and readable as possible, in order to lessen the chance of bugs. Have as little code running as possible.

Compilers are quite smart nowdays, even runtime ones.

Less important than how you organise is basically not wasting cpu cycles on things that aren't necessary (doing things too often) and allocating memory on the fly (dynamically calling variables rather than using existing ones).

In response to SpikeX, there's nothing wrong with knowing how the underlying tech of what you're doing works. Only with better understanding of how things work can you improve upon what you make :)

None of these issues that you're mentioning are going to affect your gameplay in any way whatsoever. It doesn't matter if you have one class or two, or if you split functions into multiple parts. The difference in performance probably isn't even measurable. Why are you even worrying about these mundane details in the first place?