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
I got an unexpected result.
imho, the tests are not comparable
STRUCT2 has a constructor
STRUCT2 has strings
there is no documentation about strings as implemented in MQL, we discussedhttps://www.mql5.com/ru/forum/1111/page2732#comment_16181920
i.e. in your test, STRUCT2 works as a class with a constructor, which has a "string class" with a constructor, which is in effect allocating memory for the object several times
I think such a complex test must be broken down into several tests - the time of creating STRUCT1 and STRUCT2 structures and then the time of accessing data. Some developers wrote that string is allocated memory only after accessing string - in your example, string is initialized by a constant string, so it is hard to see how it is initialized - the compiler may not initialize (or allocate memory?) arrays of strings before accessing them
I think such a complex test should be broken down into several tests
I don't even want to bother. I made simple structures.
For what reason access to the first field of a simple structure depends on its size - is not clear.
I don't even want to bother. I made simple structures.
For what reason access to the first field of a simple structure depends on its size - is not clear.
It is better to ask this question to developers in the corresponding branch. With test code. Either they will explain it, or they will fix it, or they won't say anything... Only the third variant will probably work here.
This is a question best posed to the developers in the relevant branch. With the test code. Either they will explain it, or they will fix it, or they will say nothing... Here is probably only the third option.
My MT5 has started to cause too much profanity. There are critical bugs. This is bullshit.
I don't even want to bother. I have made simple structures.
now the same STRUCT1 and STRUCT3 tests
I do not understand why access to the first field of a simple structure depends upon its size.
This is just a guessing game.
another way is to wait for someone to do the same test in C++ and display the results. If there is a big difference, it means that memory allocation in MQL is poorly implemented
if tests 1 and 2 are about the same, it is Windows that is allocating memory this way
My MT5 has started to cause too much profanity. There are critical bugs. This is bullshit.
It is advisable to report all bugs. Critical and not. Emotionless, of course :)
if tests 1 and 2 are about the same, then that's the way Windows is allocating memory
ran the last test 2 times on
Terminal MetaTrader 5 x64 build 2470 started for MetaQuotes Software Corp.
2020.05.30 17:01:27.996 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 53: ArrayResize(Array1,Amount)] = 1 ms.
2020.05.30 17:01:27.996 tst_f (EURUSD,H1) 50000000
2020.05.30 17:01:28.002 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 54: ArrayResize(Array3,Amount)] = 6 ms.
2020.05.30 17:01:28.002 tst_f (EURUSD,H1) 50000000
2020.05.30 17:01:28.515 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 56: Func(Array1)] = 512 ms.
2020.05.30 17:01:28.515 tst_f (EURUSD,H1) 1333106752
2020.05.30 17:01:30.734 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 57: Func(Array3)] = 2218 ms.
2020.05.30 17:01:30.734 tst_f (EURUSD,H1) 1333106752
2020.05.30 17:01:41.278 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 53: ArrayResize(Array1,Amount)] = 2 ms.
2020.05.30 17:01:41.278 tst_f (EURUSD,H1) 50000000
2020.05.30 17:01:41.287 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 54: ArrayResize(Array3,Amount)] = 9 ms.
2020.05.30 17:01:41.287 tst_f (EURUSD,H1) 50000000
2020.05.30 17:01:41.840 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 56: Func(Array1)] = 552 ms.
2020.05.30 17:01:41.840 tst_f (EURUSD,H1) 1333106752
2020.05.30 17:01:43.728 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 57: Func(Array3)] = 1888 ms.
2020.05.30 17:01:43.728 tst_f (EURUSD,H1) 1333106752
not all files are attached to the script, last lines did not compile
I had the Debug.mqh includer
UPD: on old build I ran the test
2020.05.30 17:17:27.604 Terminal MetaTrader 5 - build 2361
2020.05.30 17:13:17.046 tst (EURUSD,H1) Alert: Time[tst.mq5 53: ArrayResize(Array1,Amount)] = 1 ms.
2020.05.30 17:13:17.047 tst (EURUSD,H1) 50000000
2020.05.30 17:13:17.053 tst (EURUSD,H1) Alert: Time[tst.mq5 54: ArrayResize(Array3,Amount)] = 6 ms.
2020.05.30 17:13:17.053 tst (EURUSD,H1) 50000000
2020.05.30 17:13:17.563 tst (EURUSD,H1) Alert: Time[tst.mq5 56: Func(Array1)] = 510 ms.
2020.05.30 17:13:17.563 tst (EURUSD,H1) 1333106752
2020.05.30 17:13:19.416 tst (EURUSD,H1) Alert: Time[tst.mq5 57: Func(Array3)] = 1852 ms.
2020.05.30 17:13:19.416 tst (EURUSD,H1) 1333106752
2020.05.30 17:13:28.971 tst (EURUSD,H1) Alert: Time[tst.mq5 53: ArrayResize(Array1,Amount)] = 2 ms.
2020.05.30 17:13:28.971 tst (EURUSD,H1) 50000000
2020.05.30 17:13:28.977 tst (EURUSD,H1) Alert: Time[tst.mq5 54: ArrayResize(Array3,Amount)] = 6 ms.
2020.05.30 17:13:28.977 tst (EURUSD,H1) 50000000
2020.05.30 17:13:29.456 tst (EURUSD,H1) Alert: Time[tst.mq5 56: Func(Array1)] = 478 ms.
2020.05.30 17:13:29.456 tst (EURUSD,H1) 1333106752
2020.05.30 17:13:31.192 tst (EURUSD,H1) Alert: Time[tst.mq5 57: Func(Array3)] = 1735 ms.
2020.05.30 17:13:31.192 tst (EURUSD,H1) 1333106752
All bugs should preferably be reported. Critical or not. Unemotionally of course :)
Detailed branches have been created.
Try swapping their announcements. Doesn't it depend on which one is at the top of the stack?
2020.05.30 17:33:07.892 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 54: ArrayResize(Array3,Amount)] = 6 ms.
2020.05.30 17:33:07.955 tst_f (EURUSD,H1) 50000000
2020.05.30 17:33:07.957 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 55: ArrayResize(Array1,Amount)] = 1 ms.
2020.05.30 17:33:07.957 tst_f (EURUSD,H1) 50000000
2020.05.30 17:33:09.902 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 58: Func(Array3)] = 1945 ms.
2020.05.30 17:33:09.902 tst_f (EURUSD,H1) 1333106752
2020.05.30 17:33:10.353 tst_f (EURUSD,H1) Alert: Time[tst_f.mq5 59: Func(Array1)] = 450 ms.
2020.05.30 17:33:10.353 tst_f (EURUSD,H1) 1333106752