29.05.2010, 18:08
Quote:
Originally Posted by Incognito
...
|
----------------------------------------------------------------------
I made some tests now.
pawn Код:
COMMAND:test(playerid,params[])
{
new tick = GetTickCount();
for(new i=0; i<100000; i++)
{
SetPVarInt(playerid,"RandomID",i);
}
printf("tick #1: %d",GetTickCount() - tick);
tick = GetTickCount();
for(new i=0; i<100000; i++)
{
GetPVarInt(playerid,"RandomID");
}
printf("tick #2: %d",GetTickCount() - tick);
tick = GetTickCount();
for(new i=0; i<100000; i++)
{
SetGVarInt("RandomID",i);
}
printf("tick #3: %d",GetTickCount() - tick);
tick = GetTickCount();
for(new i=0; i<100000; i++)
{
GetGVarInt("RandomID");
}
printf("tick #4: %d",GetTickCount() - tick);
tick = GetTickCount();
for(new i=0; i<100000; i++)
{
SOMETHING[randomshit] = i;
}
printf("tick #5: %d",GetTickCount() - tick);
tick = GetTickCount();
for(new i=0; i<100000; i++)
{
i = SOMETHING[randomshit];
}
printf("tick #6: %d",GetTickCount() - tick);
return 1;
}
[20:45:01] tick #1: 38
[20:45:01] tick #2: 33
[20:45:01] tick #3: 102
[20:45:01] tick #4: 100
[20:45:01] tick #5: 12
[20:45:01] tick #6: 2
I don't know anything about plugin programming, but could this be somehow speeded up a bit? GVars seem to be around three times slower than PVars.