Fastest String Loop
#7

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
hmm can you test its speed? im not home these days so i cant test myself.

Код:
new j=strlen(string);

do
{
  j--;
 //-----
}while(j!=0);
It's really slow, I added it to the main post.

-----------------

Well, I'm not sure which one is the best option now.

for(new j = (strlen(cmd) - 1); j > -1; j --)
for(new j = (strlen(cmd) - 1); j != 0; j --)

Both seem to be the fastest in a production scenario.

-----------------

for(new j = strlen(string); j != 0; j --)

It becomes very slow in a production use, but seems to be the fastest in a plain loop.

-----------------

for(new j = 0, k = strlen(string); j != k; j ++)

Slice's fastest loop to his experience seems slower than the first loop in a production use, but faster in a plain loop.
Reply


Messages In This Thread
Fastest String Loop - by SickAttack - 11.10.2016, 03:03
Re: Fastest String Loop - by SyS - 11.10.2016, 03:48
Re: Fastest String Loop - by SickAttack - 11.10.2016, 04:57
Re: Fastest String Loop - by Gammix - 11.10.2016, 05:55
Re: Fastest String Loop - by Yashas - 11.10.2016, 07:09
Re: Fastest String Loop - by SyS - 11.10.2016, 07:54
Re: Fastest String Loop - by SickAttack - 11.10.2016, 14:56
Re: Fastest String Loop - by Luicy. - 11.10.2016, 15:16
Re: Fastest String Loop - by SyS - 11.10.2016, 15:18
Re: Fastest String Loop - by SickAttack - 11.10.2016, 15:27
Re: Fastest String Loop - by Jayse - 11.10.2016, 16:22
Re: Fastest String Loop - by Stinged - 11.10.2016, 18:18
Re: Fastest String Loop - by Konstantinos - 11.10.2016, 18:42

Forum Jump:


Users browsing this thread: 1 Guest(s)