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

 
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 ?

Right, I have said that already. It's negligible. I just posted my investigation. Haha and yes I'm retired. I'm bored so I checked it out. :) 

 
Amir Yacoby:

What about the test I asked?

I've posted it. Where's your proof. As someone said this is a forum of facts and scientific attitude. Believe me that I want to believe you. but do you want me to take your opinion just because you said it?

 
Joel Protusada:

I've posted it. Where's your proof. As someone said this is a forum of facts and scientific attitude. Believe me that I want to believe you. but do you want me to take your opinion just because you said it?

The code you posted shows this result for both '<':

for 100 cycles, '<' is faster than '<'

That's it, negligible, but faster.

* And I didn't run it, nor intend to.

 
Amir Yacoby:

The code you posted shows this result for both '<':

for 100 cycles, '<' is faster than '<'

That's it, negligible, but faster.

Ok thank you for confirming that. 

 
Joel Protusada:

Ok thank you for confirming that. 

Hey I'm sorry for everything. I just don't know why after I posted violent reactions suddenly flooded the thread. I'm just sharing what I know.  

 
Joel Protusada:

Hey I'm sorry for everything. I just don't know why after I posted violent reactions suddenly flooded the thread. I'm just sharing what I know.  

Peace. All is well.
 

That's ok Joel!

But there's also a logical explanation to that : '<' is interpreted like '<='.

for(int i=0;i<=10;i++)
for(int i=0;i<11;i++)

In both case i=11 won't be called. If you found a difference there, it's negligible and probably due to the execution condition (CPU/RAM etc ...). 

If you really really really wanna be sure, you should try to run the test many times & individually for '<' and '<='...

 

Just woke up and I found 25 new posts, you make my day guys.


 
Alain Verleyen:

Just woke up and I found 25 new posts, you make my day guys.


And you're the 26.. and right now I've posted the 27th.. let's make this the longest post in the site.. 

 
Amir Yacoby:

What about the test I asked?

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

int TestL1()
{   
   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 TestL2()
{
   int max1 = INT_MAX-1;
   iStart = GetMicrosecondCount();
   for (int i=0; i<=max1; i++)
      bResult = max1<i;
   iStop = GetMicrosecondCount();
   return int(iStop-iStart);
}
2019.09.16 08:19:07.461 321859 EURUSD,M15: Run   1:    (<) 15086601      (<) 12131287     (Diff)  2955314       (Total)  2955314       (Average) 2955314.000000
2019.09.16 08:19:29.547 321859 EURUSD,M15: Run   2:    (<) 10089671      (<) 11995637     (Diff) -1905966       (Total)  1049348       (Average) 524674.000000
2019.09.16 08:19:53.865 321859 EURUSD,M15: Run   3:    (<) 10733928      (<) 13583845     (Diff) -2849917       (Total) -1800569       (Average) -600189.000000
2019.09.16 08:20:19.118 321859 EURUSD,M15: Run   4:    (<) 12657216      (<) 12596919     (Diff)    60297       (Total) -1740272       (Average) -435068.000000
2019.09.16 08:20:44.821 321859 EURUSD,M15: Run   5:    (<) 14043893      (<) 11659190     (Diff)  2384703       (Total)   644431       (Average) 128886.000000
2019.09.16 08:21:06.483 321859 EURUSD,M15: Run   6:    (<)  9636829      (<) 12024359     (Diff) -2387530       (Total) -1743099       (Average) -290516.000000
2019.09.16 08:21:34.407 321859 EURUSD,M15: Run   7:    (<) 13279711      (<) 14643533     (Diff) -1363822       (Total) -3106921       (Average) -443845.000000
2019.09.16 08:22:02.083 321859 EURUSD,M15: Run   8:    (<) 11086120      (<) 16590362     (Diff) -5504242       (Total) -8611163       (Average) -1076395.000000
2019.09.16 08:22:24.829 321859 EURUSD,M15: Run   9:    (<) 10943973      (<) 11802022     (Diff)  -858049       (Total) -9469212       (Average) -1052134.000000
2019.09.16 08:22:49.693 321859 EURUSD,M15: Run  10:    (<) 12429129      (<) 12435279     (Diff)    -6150       (Total) -9475362       (Average) -947536.000000

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.