Features of the mql5 language, subtleties and tricks - page 237
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
Looked at the format.
Probably won't speed it up. Heard about the miraculous speed of the switch, though.
A sparse switch doesn't give miraculous speed.
The most marvellous speed will be in a switch with cases from zero to 255 in increments of 1
Sparse switch doesn't give you marvellous speed.
The most marvellous speed will be in a switch with cases from zero to 255 in increments of 1
Thank you.
my results from your test:
I don't like the test itself very much, because 10 million of the same calculations take place in the test. In this case, there is no guarantee that the compiler will not give surprises in its attempts to optimise the code.
And these values should be divided by 21, because there are 21*10 000 000 iterations in total.
However, this test also confirms my conclusions, but for my processor, which seems to be fresher and, therefore, uses modern performance features to the maximum and, therefore, is more objective because it is more up-to-date.
It would be interesting to see the results of this test for others.
Thanks.
It was late yesterday when I posted the results WITHOUT compiler optimisation.
Here are the results with cpu='AVX2 + FMA3' and max optimisation.
The main difficulty in this algorithm is calculating the start time of the month (highlighted in green).
The most interesting thing in the code and almost not touched upon in the discussion.
The most interesting thing in the code and almost not touched on in the discussion.
I faced the necessity to save very short code (< 15 lines) in the form of mqh-library.
It is a forced measure because pointers to functions are possible only for functions from the global scopus.
How short libraries do you use?
Forum on trading, automated trading systems and testing trading strategies
Errors, bugs, questions
fxsaber, 2023.11.26 23:26
If I understand correctly, in this case the A::f() method is inlined in g().
And here it is not.
Will A::f() be inlined by the compiler in the second case, provided that no descendant objects of class A are created anywhere in the code?
With this application.
When I need to create this condition, I just change the graph display mode in the visualiser.
And then I analyse the behaviour of the EA in ME.
I never imagined that I would use a machine-generated piece of code in the source code. Especially in a place that is archival for performance.
Below is the generated code.
A much more concise script was written for the generation. It can be expedient to quickly test hypotheses and avoid human errors.