fastest and most effective possible?
#5

Quote:
Originally Posted by Spenker
Посмотреть сообщение
Why?
Difference?
Код HTML:
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
/
Код HTML:
for(new i = 0; i <= GetPlayerPoolSize(); i++)
First one calls GetPlayerPoolSize once, and stores its value in j.
Second one calls GetPlayerPoolSize multiple times (Depending on the value it actually outputs).

So yes, the first one is actually faster.

But to answer your main question, iterators (y_iterate/foreach) are much faster.
They only loop through the existing values, while the second one loops N times.
*N = The highest player id in the server.
Reply


Messages In This Thread
fastest and most effective possible? - by Spenker - 17.10.2016, 18:20
Re: fastest and most effective possible? - by SickAttack - 17.10.2016, 18:33
Re: fastest and most effective possible? - by Spenker - 17.10.2016, 18:48
Re: fastest and most effective possible? - by SickAttack - 17.10.2016, 18:54
Re: fastest and most effective possible? - by Stinged - 17.10.2016, 18:54
Re: fastest and most effective possible? - by Misiur - 17.10.2016, 19:08
Re: fastest and most effective possible? - by Spenker - 17.10.2016, 19:36
Re: fastest and most effective possible? - by Spenker - 18.10.2016, 17:56
Re: fastest and most effective possible? - by SickAttack - 18.10.2016, 17:59

Forum Jump:


Users browsing this thread: 3 Guest(s)