Is <11 faster than <=10? - page 8

 
Alain Verleyen:

I ran it, and I should not have, now my world view is shaken.

2019.09.16 08:58:39.333    321859 EURUSD,M15: ********* With 100 cycles, (<) is faster than (<)

They should be equal and they are not. To be sure I didn't make a mistake I reversed both '<' and still the results are not equal. The world is becoming so weird.

Something with the climate

 
Alain Verleyen:

I ran it, and I should not have, now my world view is shaken.

2019.09.16 08:58:39.333    321859 EURUSD,M15: ********* With 100 cycles, (<) is faster than (<)

They should be equal and they are not. To be sure I didn't make a mistake I reversed both '<' and still the results are not equal. The world is becoming so weird.

You didn't change this in TL
 for (int i=0; i<=max1; i++)
 
Alain Verleyen:

I ran it, and I should not have, now my world view is shaken.

2019.09.16 08:58:39.333    321859 EURUSD,M15: ********* With 100 cycles, (<) is faster than (<)

They should be equal and they are not. To be sure I didn't make a mistake I reversed both '<' and still the results are not equal. The world is becoming so weird.

I'm curious. I changed it for you

int TestL()
{   
   int max1 = INT_MAX-1;
   iStart = GetMicrosecondCount();
   for (int i=0; i<INT_MAX; i++)
      bResult = max1<i;
   iStop = GetMicrosecondCount();
   return int(iStop-iStart);
}

int TestLT()
{
   int max1 = INT_MAX-1;
   iStart = GetMicrosecondCount();
   for (int i=0; i<INT_MAX; i++)
      bResult = max1<i;
   iStop = GetMicrosecondCount();
   return int(iStop-iStart);
}

Here is the output

2019.09.16 22:27:51.713 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  79:    (<)  3737702      (<)  3740916     (Diff)    -3214       (Total)  1134403       (Average) 14359.000000
2019.09.16 22:27:59.277 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  80:    (<)  3802115      (<)  3759077     (Diff)    43038       (Total)  1177441       (Average) 14718.000000
2019.09.16 22:28:06.926 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  81:    (<)  3834116      (<)  3805614     (Diff)    28502       (Total)  1205943       (Average) 14888.000000
2019.09.16 22:28:14.503 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  82:    (<)  3822999      (<)  3763705     (Diff)    59294       (Total)  1265237       (Average) 15429.000000
2019.09.16 22:28:22.024 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  83:    (<)  3760171      (<)  3754060     (Diff)     6111       (Total)  1271348       (Average) 15317.000000
2019.09.16 22:28:29.599 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  84:    (<)  3773115      (<)  3808566     (Diff)   -35451       (Total)  1235897       (Average) 14713.000000
2019.09.16 22:28:37.360 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  85:    (<)  3809926      (<)  3940577     (Diff)  -130651       (Total)  1105246       (Average) 13002.000000
2019.09.16 22:28:45.078 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  86:    (<)  3877727      (<)  3852066     (Diff)    25661       (Total)  1130907       (Average) 13150.000000
2019.09.16 22:28:52.827 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  87:    (<)  3854954      (<)  3887586     (Diff)   -32632       (Total)  1098275       (Average) 12623.000000
2019.09.16 22:29:00.520 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  88:    (<)  3785339      (<)  3903299     (Diff)  -117960       (Total)   980315       (Average) 11139.000000
2019.09.16 22:29:08.237 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  89:    (<)  3943434      (<)  3773079     (Diff)   170355       (Total)  1150670       (Average) 12928.000000
2019.09.16 22:29:15.782 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  90:    (<)  3784812      (<)  3769816     (Diff)    14996       (Total)  1165666       (Average) 12951.000000
2019.09.16 22:29:23.251 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  91:    (<)  3718407      (<)  3740813     (Diff)   -22406       (Total)  1143260       (Average) 12563.000000
2019.09.16 22:29:31.009 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  92:    (<)  3792317      (<)  3966342     (Diff)  -174025       (Total)   969235       (Average) 10535.000000
2019.09.16 22:29:38.777 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  93:    (<)  3959925      (<)  3807756     (Diff)   152169       (Total)  1121404       (Average) 12058.000000
2019.09.16 22:29:46.654 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  94:    (<)  3951624      (<)  3932382     (Diff)    19242       (Total)  1140646       (Average) 12134.000000
2019.09.16 22:29:54.519 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  95:    (<)  3890034      (<)  3967545     (Diff)   -77511       (Total)  1063135       (Average) 11190.000000
2019.09.16 22:30:02.416 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  96:    (<)  3995389      (<)  3905655     (Diff)    89734       (Total)  1152869       (Average) 12009.000000
2019.09.16 22:30:10.412 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  97:    (<)  3938436      (<)  4052935     (Diff)  -114499       (Total)  1038370       (Average) 10704.000000
2019.09.16 22:30:18.218 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  98:    (<)  4034110      (<)  3773447     (Diff)   260663       (Total)  1299033       (Average) 13255.000000
2019.09.16 22:30:25.808 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run  99:    (<)  3799942      (<)  3793120     (Diff)     6822       (Total)  1305855       (Average) 13190.000000
2019.09.16 22:30:33.280 2019.08.01 00:00:00  if statement 6 EURUSD,M15: Run 100:    (<)  3764316      (<)  3710284     (Diff)    54032       (Total)  1359887       (Average) 13598.000000
2019.09.16 22:30:33.297 2019.08.01 00:00:00  if statement 6 EURUSD,M15: ********* With 100 cycles, (<=) is faster than (<)
 

I have deleted a number of posts.

Please remain civil.

 
Meztiza Ako:
You didn't change this in TL
Meztiza Ako:

I'm curious. I changed it for you

Here is the output

I don't have to change anything it's not my code. And <=max1 is exactly the same as <INT_MAX when max1=INT_MAX-1.

This topics is surrealist.

 
Keith Watford:

I have deleted a number of posts.

Please remain civil.

Damn it, it will be hard to reach 100 posts if you delete them
 
Icham Aidibe:

Well those installing MT on Linux were probably using Linux before knowing MT and need it for others tasks.

Back to the topic, 

Is <11 faster than <=10?

My opinion upon is that if there's a difference it's negligible.

Your issue ain't an issue, you're procrastinating, it's a loss of time, funny for someone who wanna gain some, isn't it ?

"Well those installing MT on Linux"

Windows is an insult to any computer enthusiast.

"Your issue ain't an issue"

Glad its currently not an issue for you personally. After all, you didn't start the thread.

 
Joel Protusada:

You will best understand these results if you will read the code I posted.

First run with 100 cycles...

2nd run with 100 cycles...

3rd run...

 Running the exact same code that you posted, I get:


 
He also changed to this, because it's '<' against '<':
   string result = "********* With 100 cycles, "; 
   if(ave<0) result += "(<) is faster than (<)";
   else result += "(<) is faster than (<)";
 
For the timescale of MT4/5, it is pointless most of all if you consider the ping between the computer on which the EA/indicator is running and your broker's server. You may want to optimize you in some other ways...
On another matter, if you work with integers, it will be exactly the same. But, if you work with decimals (float or double for example) it is tricky. If I want to open trades only if the spread is inferior or equal to 1.5 pips, I will prefer if spread<1.6 and not if spread<=1.5.
How many times my condition if was not fulfilled when it should have been or conversely, fulfilled when it shouldn't have been only because of hidden decimals. If you display your spread in a Comment(); instruction, you will probably have 1.50024 or 1.49987.
Reason: