Code optimization questions
#1

Okay, I'm making a SII/MYSQL based saving + admin system and I'm optimizing the code now.

So, I want to know some stuff:

What is the difference between new and static? Which one should be used to set global variables and which should be used to get names and etc.?

+ Is there an easier way to create strings instead of creating static fuckedString[CELLSIZEHERE];? Like a simpler way which would be more effective.

I'm trying to make a really efficient system so I need to know the following ^^.


Basically:

would this be efficient

pawn Код:
// On the top of the script
new GlobalString[220];

// Under some function or cmd

format(GlobalString, sizeof(GlobalString), "SHITHERE %d %d", crap, crap);
OR


pawn Код:
// In all functions and cmd

new gString[120];
format(gString, sizeof(gString), "CRAP CRAP CRAP");
better?


AND

is

pawn Код:
// Below every function/cmd

new gString[120];
format(gString ... );
BETTER OR


pawn Код:
static gString[120];
format(gString ... );
Reply


Messages In This Thread
Code optimization questions - by Gangs_Rocks - 01.08.2012, 12:26
Re: Code optimization questions - by Misiur - 01.08.2012, 12:38
Re: Code optimization questions - by Gangs_Rocks - 01.08.2012, 12:53
Re: Code optimization questions - by Misiur - 01.08.2012, 12:57

Forum Jump:


Users browsing this thread: 1 Guest(s)