25.04.2012, 16:00
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
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
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.
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" );
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.