Check efficiency of my script
#1

Well, how can I do to check it's efficiency?

Thanks
Reply
#2

Read ******'s optimization guide!
Reply
#3

I did!

I use sscanfv2+zcmd, but I have the curiosity on how much fast is my script..
Reply
#4

Get a couple friends (10+) on a professionally hosted server and test out the fundamentals of your script. If it all works well, without any lag or problems, you should be okay. Of course, that's the newbie way... I would read over all of ******'s threads, they all seem to make an ass ton of sense.
Reply
#5

Keep your array cells just right above the needed amount (don't overdo it) and remove useless checks and stuff, and your script is already "pretty" efficient.
Reply
#6

From a W.I.P. of mine:
pawn Код:
#define DEBUG_PREFORMANCE_WARNING_THRESOLD 1

#define PERFORMANCE_CHECK_START(%0); \
    new \
        iStartTick = GetTickCount( ) \
    ;

#define PERFORMANCE_CHECK_FINISH(%0); \
    iStartTick = GetTickCount( ) - iStartTick; \
     \
    if ( iStartTick >= DEBUG_PREFORMANCE_WARNING_THRESOLD ) \
    { \
        printf( "PERFORMANCE WARNING: " %0 " was executed in %d ms.", iStartTick ); \
    }
Example usage:

pawn Код:
public OnPlayerSpawn( playerid )
{
    PERFORMANCE_CHECK_START( );
   
    // do stuff ..
   
    PERFORMANCE_CHECK_FINISH( "OnPlayerSpawn" );
}
If the function takes more than 1 ms, a warning will be shown in the server log / console.
Reply
#7

Thanks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)