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
if you write such classes:
judging from your research, class B will be slower to execute if you use structure fields frequently in calculations?
So, we were discussing the time of traversing an array of objects)))
According to your example it will be the same in pluses, but in mql there's a nuance, there are two implicit fields which go first, so, data field will be approached by shift, i.e. additional calculations during dereferencing.
So, we were discussing the time of traversing the array of objects)))
According to your example it will be the same in pluses, but in mql there's a nuance, there are two implicit fields, which go first, so, data field will be approached by shift, i.e. additional calculations during dereferencing.
Thank you, that's helpful!
So, we were discussing the object array traversal time)))
According to your example it will be the same in pluses, but in mql there's a nuance: there are two implicit fields which go first, so data field will be accessed at an offset, i.e. additional dereferencing calculations will be performed.
So, no mysticism - the laws of physics in action.
It doesn't fit the "laws of physics".
This is a paradoxical result. More complex calculations are performed 1.5 times faster and do not depend on size.
So, we were discussing the object array traversal time)))
According to your example it will be the same in pluses, but there's a subtlety in mql: there are two implicit fields that go first, so data field will be accessed at an offset, i.e. additional dereferencing calculations will be performed.
Thanks to Vladimir for the assembler study.
And as Alexey suggests, the overhead is created by classes.
From this we can conclude that if you can do without classes, it's better to write code in procedural style.
That is, if the task does not require speed, you can wrap it in a class, but if you are dealing with ticks, for example, you'd better use it directly without wrappers.
In principle, this is the approach I followed, and often finding an example of a class, I disassemble its methods in procedural approach.
Thanks Vladimir for the assembly study.
And as Alexey suggests, overhead creates classes.
From this we can conclude that if we can do without classes, it is better to write code in procedural style.
That is, if the task does not require speed, you can wrap it in a class, but if you are dealing with ticks, for example, you'd better write directly without wrappers.
In principle, this is the approach I've been following and often upon finding an example of a class, I disassemble its methods using procedural approach.
There's a troll on the forum...
I used to not understand why some users ask for the ignore function, ah how it's missing now...
Forum on trading, automated trading systems and strategy testing
OOP questions in MQL5
fxsaber, 2020.05.30 14:06
I have no idea what to do with it. I have made simple structures.
I'm not sure why the access to the first field of a simple structure depends on its size.
For structures of size 20 and 84 bytes this is 0.93GB and 3.91GB of data, respectively.
And in the frame of your calculation, presumably, all this memory goes through the processor's cache.
And a very logical explanation for these results would be that 0.93 GB of data would be downloaded from memory into the CPU cache four times faster than the 3.91 GB of data.
What about the results of the C++ test?
Because I've seen assembler code, but no test results, or did I look badly?
There's a troll on the forum...
I used to not understand why some users ask for the ignore function, ah how it's missing now...
You should watch out for yourself, not others.
Not you and not for you was the answer.
Ignore in silence ))
For structures of 20 and 84 bytes, that's 0.93GB and 3.91GB of data respectively.
And as part of your calculation, presumably all of this memory goes through the processor's cache.
And a very logical explanation for these results would be that 0.93 GB of data would be downloaded from memory into the CPU cache four times faster than the 3.91 GB of data.
What about the results of the C++ test?
Because I've seen assembler code, but no test results, or did I look badly?
Thanks Vladimir for the assembly study.
And as Alexey suggests, overhead creates classes.
From this we can conclude that if we can do without classes, it is better to write code in procedural style.
That is, if the task does not require speed, you can wrap it in a class, but if you are dealing with ticks, for example, you'd better use it directly without wrappers.
In principle, this is the approach I take, and often finding an example of a class, I disassemble its methods in procedural style.
You can use a structure instead of a class, they're fine.