Check efficiency of my script - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check efficiency of my script (
/showthread.php?tid=184248)
Check efficiency of my script -
The_Moddler - 18.10.2010
Well, how can I do to check it's efficiency?
Thanks
Re: Check efficiency of my script - [L3th4l] - 18.10.2010
Read ******'s optimization guide!
Respuesta: Check efficiency of my script -
The_Moddler - 18.10.2010
I did!
I use sscanfv2+zcmd, but I have the curiosity on how much fast is my script..
Re: Check efficiency of my script -
Scenario - 18.10.2010
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.
Re: Check efficiency of my script -
LarzI - 18.10.2010
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.
Re: Check efficiency of my script -
Slice - 18.10.2010
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.
Respuesta: Check efficiency of my script -
The_Moddler - 18.10.2010
Thanks !