![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Found it! Managed to get a higher speed with the PLO after all. Yes! The benefits are undeniable.
Let's write everything in assembly language then. It would be faster anyway.
I don't understand the problem. I have never seen an Expert Advisor or indicator with 1 MB of code.
The call of any function also takes some time. Let's give up functions as well!
Control over large projects is much more convenient with OOP.
Also, code execution speed is very often not as critical as pinging time to broker and response to broker's order.
Check out the HFT algorithms. They require maximum speed, but you won't find any complex calculations there.
PS. You don't usually need a supercar or a snowmobile to get from point A to point B. A moped is enough! A moped is enough!
Found it! Still managed to get a higher speed with the PLO. Yes! The benefits are undeniable.
So, what was the code?
In the new build of the MQL compiler, we have already included the optimization of replacing a virtual method with a direct call if it is the final method in a chain of virtual methods and there are no links to external libraries.
This method will simplify and speed up virtual calls to many programs that work with classes.
The results of the test.mq4 example from the first post in the 670 build:
The loop had to be increased from 10,000,000 to 50,000,000 in order not to work with minuscule time measurements of 32-64 ms. Time in ms is shown, the smaller number is, the faster code is.
This is what I got with the new compiler on the same code:
OOP won with a bang. But why?
First, the virtual method was turned into a regular method, and then it was inline and optimized to zero. In fact, the function call and body disappeared completely, leaving a pure loop:
The files are attached, including the new beta of the console compiler. You can compare any examples using regular 670 build of MetaEditor (the compiler is built into it) and the console compiler.
What this proves: