Get playerid from listitem.
#14

Quote:
Originally Posted by cessil
View Post
when you say PVars are slow you\'re talking tens of thousands of a millisecond like 0.00023 ms according to some speed tests, meaning you\'d have to use over ten thousand in the one function to notice any slow down
Quote:
Originally Posted by cessil
View Post
with format and pvar you still need to enter the thousands for it to start taking over 1ms
Well i did some benchmarking, and it takes like 1ms when you iterate over 900 items and with 10.000 it takes 5ms to run the code. Ofcourse almost nobody will reach more then 900 players and for a dialog list is it okay to use it this way yeah, but it still takes some time to run this, then what you did stated.


Also the code i use to benchmark it:
PHP Code:
    new tick GetTickCount();
    new 
string[20];
    for (new 
0!= 10000; ++i) {
        
format(stringsizeof(string), "stats_%d_player"i);
        
SetPVarInt(playeridstringi);
    }
    
printf("End: %dms", (GetTickCount() - tick)); 
Reply


Messages In This Thread
Get playerid from listitem. - by CherryMond - 02.01.2019, 17:41
Re: Get playerid from listitem. - by NaS - 02.01.2019, 17:50
Re: Get playerid from listitem. - by CherryMond - 02.01.2019, 18:12
Re: Get playerid from listitem. - by RoboN1X - 03.01.2019, 03:34
Re: Get playerid from listitem. - by Kane - 03.01.2019, 08:40
Re: Get playerid from listitem. - by CherryMond - 03.01.2019, 20:27
Re: Get playerid from listitem. - by BlackBank - 03.01.2019, 22:33
Re: Get playerid from listitem. - by cessil - 03.01.2019, 23:04
Re: Get playerid from listitem. - by BlackBank - 03.01.2019, 23:11
Re: Get playerid from listitem. - by Y_Less - 04.01.2019, 00:16
Re: Get playerid from listitem. - by Threshold - 04.01.2019, 05:58
Re: Get playerid from listitem. - by cessil - 04.01.2019, 07:10
Re: Get playerid from listitem. - by Y_Less - 04.01.2019, 11:12
Re: Get playerid from listitem. - by BlackBank - 04.01.2019, 19:50
Re: Get playerid from listitem. - by CherryMond - 04.01.2019, 22:54
Re: Get playerid from listitem. - by Pottus - 05.01.2019, 04:17

Forum Jump:


Users browsing this thread: 1 Guest(s)