
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You seem to confuse execution with parsing. Parsing is done before execution in compilers, it won't affect the execution time which starts only after all parsing is finished and the assembly program is ready and only then it is run. As also confirmed by Ilyas 2 posts above, this is the answer.
And you insist, really ?
All you reasoning above is completely irrelevant. The topic is not about how fast it is to compile a source code but how fast it is to execute a compiled code. Without starting a detailed discussion about how a compiler (actually a lexer/parser) works, if your compiler can't translate ">=" into 1 assembly instruction (JLE) but translate it into 2 instructions (JL + JZ/JNZ), you have a serious problem and your compiler will be very bad.
You are quite stubborn, isn't the answer from Ilyas, a Metaquotes developper enough to convince you ? It seems really hard for you to admit you are wrong, but you are without a question.
Hey, from the start I stated that I respect your opinion. I'm just expressing my own opinion and you are also free to express yours. This is a forum. That's how it should work. It's a two way street. I'm discussing. I'm not the one insisting.
Hey, from the start I stated that I respect your opinion. I'm just expressing my own opinion and you are also free to express yours. This is a forum. That's how it should work. It's a two way street. I'm discussing. I'm not the one insisting.
Exactly the same in MQL4 and MQL5
Exactly the same/very negligible for all Data Types in MQL4 and also the exact same situation when handling all Data Types in MQL5?
This is due to the fact that at some point in the compiling/parsing the instructions we type in MetaEditor (for ALL Data Types) get translated/processed in a such a manner that its essentially the same microseconds consumed from one step to next regardless of it being 1 (as in just <) or 2 (as in <=) "comparisons"?
Great to know we don't need to change every <= into < in order to have more efficient code.I did this simple test:
And I gathered these results:
Clearly, < is faster than <=, although the difference is negligible.
It clearly does not say what you claim (average difference is 0.62 percent).
My tests show the opposite:
Seems to me this discrepancy is due to different approaches to testing
Seems to me this discrepancy is due to different approaches to testing
To some extent, you're right - for one, I noticed (subsequently) that swapping the sequence of the two tests can give rise to different bias. Also, fluctuation in pc load affects the results too.
However, the actual performances have to be quite close, if not equal, because otherwise the results should always lean towards one side (with differing magnitude of differences).
Great to know we don't need to change every <= into < in order to have more efficient code.
Try to run this code in the MT5 (64 bit version)
On MT4, I have confirmed by running these 2 different EAs 10 times each on the Strategy Tester.
Indeed, the elapsed time seems to persistently be the exact same phenomena; either 0 or 1 microsecond for the 2 EA's the same.
This clearly proves that its essentially the same time for the 2 computations at least at the microsecond level in basic usage according to the Terminal.
Second test
On MT4, I have confirmed by running these 2 different EAs 10 times each on the Strategy Tester.
Indeed, the elapsed time seems to persistently be the exact same phenomena; either 0 or 1 microsecond for the 2 EA's the same.
This clearly proves that its essentially the same time for the 2 computations at least at the microsecond level according to the Terminal.
Second test
What do you know about constant expressions?
Of course both of them was caclulated on compile time
You can change you code to below code, it will spend the same time