OnPlayerUpdate: How much is too much?
#5

well I did not use the performance profiler plugin yet,
I did use Slices bench marking marcos Just to test the code in question.

iv ran the test with different irritations
and generally im getting this number

Код:
START_BENCH( 10000 );
{
	GetPlayerPos(playerid, aPlayerInfo[playerid][pLastX],aPlayerInfo[playerid][pLastY],	aPlayerInfo[playerid][pLastZ]);
	GetPlayerFacingAngle(playerid,aPlayerInfo[playerid][pLastA]);
	aPlayerInfo[playerid][pInterior] 		= GetPlayerInterior(playerid);
	aPlayerInfo[playerid][pVituralWorld] 	= GetPlayerVirtualWorld(playerid);
}
FINISH_BENCH( "without loop" );

Bench for without loop executes, by average, 564.80 times/ms.
or close to that number

if i loop that code 500(MAX_PLAYERS) times in each bench irritation i get


Код:
START_BENCH( 10000 );
{
	for(new ixc=0;ixc<500;ixc++)
	{
		GetPlayerPos(playerid, aPlayerInfo[playerid][pLastX],aPlayerInfo[playerid][pLastY],	aPlayerInfo[playerid][pLastZ]);
		GetPlayerFacingAngle(playerid,aPlayerInfo[playerid][pLastA]);
		aPlayerInfo[playerid][pInterior] 		= GetPlayerInterior(playerid);
		aPlayerInfo[playerid][pVituralWorld] 	= GetPlayerVirtualWorld(playerid);
	}
}
FINISH_BENCH( "with loop" );
Bench for with loop: executes, by average, 4.63 times/ms.


So I guess my question(s) are..

Have I bench marked this correctly?

If I can keep the second test code above 1 times/ms
I should not have any lag in OnPlayerUpdate?


My brain tells me I can probably take up to 100ms
and still be safe?


thanks for your input.
Reply


Messages In This Thread
OnPlayerUpdate: How much is too much? - by Jonny5 - 16.04.2012, 15:09
Re: OnPlayerUpdate: How much is too much? - by AndreT - 16.04.2012, 15:13
Re: OnPlayerUpdate: How much is too much? - by Jonny5 - 16.04.2012, 15:22
Re: OnPlayerUpdate: How much is too much? - by Jonny5 - 16.04.2012, 16:30
Re: OnPlayerUpdate: How much is too much? - by Jonny5 - 25.04.2012, 16:00

Forum Jump:


Users browsing this thread: 1 Guest(s)