This is a problem with the new compiler. Everything is fine in b4410.
To what I was able to find out, the issue is not stationary... Sometimes it doesn't affect the performance, and sometimes it does. But that can change, depending on where in the source code you make changes.
I experienced this effect first (I think) on 3003...
This function indicates the presence/absence of a particular compiler optimisation, not the presence/absence of the compiler GUI flag of the same name.
After some research, I think it could be possible to use the Ackerman function to determine if the code has been optimized by the compiler or not...
It has been used for that in the past. Maybe that could be transferred to mql.
to find "first Monday of the previous month" , "the beginning of the current quarter" etc.
And just to decompose the current date into day-month-year (to know) it may be necessary once a day and this moment is not critical. Nobody calls TimeToStruct on every tick :-)
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
Dominik Egert, 2024.11.28 23:12
Results from the attached file:
And now we add Fast-variant at the beginning.
And it became 30% slower.
In general, I do not understand how to interpret the test results.
And now we add Fast-variant at the beginning.
And it became 30% slower.
In general, I do not understand how to interpret the test results.
Maybe someone can replicate this rather curious behaviour?
This is a problem with the new compiler. Everything is fine in b4410.
This is a problem with the new compiler. Everything is fine in b4410.
This function indicates the presence/absence of a particular compiler optimisation, not the presence/absence of the compiler GUI flag of the same name.
Please with a link to this thread.
TimeUtils version 1.10 has been published on the codebase.
https://www.mql5.com/en/code/53970
Cosider this old-style code to lookup up a value into a static array:
Now static arrays are evaluated at runtime, so we can redefine the array as:
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
Dominik Egert, 2024.11.28 15:37
A little more optimised version:
It's likely to be faster that way.
And inverse ?
I mean that TimeToStruct is usually paired with the inverse StructToTime function.
to find "first Monday of the previous month" , "the beginning of the current quarter" etc.
And just to decompose the current date into day-month-year (to know) it may be necessary once a day and this moment is not critical. Nobody calls TimeToStruct on every tick :-)
And back?
Partially discussed.
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
amrali, 2024.12.03 20:05
TimeUtils version1.10 has beenpublished in the code base.
https://www.mql5.com/en/code/53970