I don't know about MQL4, but when I was running a race in C++, I noticed that the code you run first is slower than the second one. Surely, it takes time to allocate memory first. Usually 5% slower.
2012.03.23 13:40:50 test EURUSD,H1: global array: 1406 milliseconds.
2012.03.23 13:40:50 test EURUSD,H1: local array: 1344 milliseconds.
now it makes sense: global variables take a bit longer, local ones faster; although I thought it didn't make any difference, I should measure it in the called function, maybe there is some other difference
2012.03.23 13:40:50 test EURUSD,H1: global array: 1406 milliseconds.
2012.03.23 13:40:50 test EURUSD,H1: local array: 1344 milliseconds.
now it makes sense: global variables take a bit longer, local ones faster; although I thought it didn't make any difference, I should measure it in the called function, maybe there is some other difference
I guess if you swap them around, the results will stay the same.
changed, and copied start() to func(), after prints start func() :
2012, 03.23 14:11:15 test EURUSD,H1: local array: 1313 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: global array: 1359 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: call function.....
2012.03.23 14:11:18 test EURUSD,H1: ph-action, local array: 1312 milliseconds.
2012.03.23 14:11:18 test EURUSD,H1: f-ction, global array: 1328 milliseconds.
As a matter of speculation, the address of the local variable is counted from the function call point, the global variable address is counted from the program call point, i.e. in order to access the global variable, one more action (add an offset) must be performed.
Zhunko: Have you swapped the global and the local? Now the local one is first followed by the global one. I should have it reversed.
I did so, but the results did not change, and I also declared an array in a separate function, called the function and compared it to a global array call
alsu, that's quite a logical assumption, but my experiments have led me to a funny idea: mql4 is for lamers, you declare it the way you want, as they say in the game. ))). Maybe I'll make some experiments with mql5 if I don't forget, it's just discussing the performance of MT5, maybe something will become clear.
in the log:
2012.03.23 13:40:50 test EURUSD,H1: global array: 1406 milliseconds.
2012.03.23 13:40:50 test EURUSD,H1: local array: 1344 milliseconds.
now it makes sense: global variables take a bit longer, local ones faster; although I thought it didn't make any difference, I should measure it in the called function, maybe there is some other difference
in the log:
2012.03.23 13:40:50 test EURUSD,H1: global array: 1406 milliseconds.
2012.03.23 13:40:50 test EURUSD,H1: local array: 1344 milliseconds.
now it makes sense: global variables take a bit longer, local ones faster; although I thought it didn't make any difference, I should measure it in the called function, maybe there is some other difference
changed, and copied start() to func(), after prints start func() :
2012, 03.23 14:11:15 test EURUSD,H1: local array: 1313 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: global array: 1359 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: call function.....
2012.03.23 14:11:18 test EURUSD,H1: ph-action, local array: 1312 milliseconds.
2012.03.23 14:11:18 test EURUSD,H1: f-ction, global array: 1328 milliseconds.
changed, and copied start() to func(), after pprinnts start func() :
2012, 03.23 14:11:15 test EURUSD,H1: local array: 1313 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: global array: 1359 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: call function.....
2012.03.23 14:11:18 test EURUSD,H1: ph-action, local array: 1312 milliseconds.
2012.03.23 14:11:18 test EURUSD,H1: f-ction, global array: 1328 milliseconds.
changed, and copied start() to func(), after prints start func() :
2012, 03.23 14:11:15 test EURUSD,H1: local array: 1313 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: global array: 1359 milliseconds.
2012.03.23 14:11:15 test EURUSD,H1: call function.....
2012.03.23 14:11:18 test EURUSD,H1: ph-action, local array: 1312 milliseconds.
2012.03.23 14:11:18 test EURUSD,H1: f-ction, global array: 1328 milliseconds.
I did so, but the results did not change, and I also declared an array in a separate function, called the function and compared it to a global array call
alsu, that's quite a logical assumption, but my experiments have led me to a funny idea: mql4 is for lamers, you declare it the way you want, as they say in the game. ))). Maybe I'll make some experiments with mql5 if I don't forget, it's just discussing the performance of MT5, maybe something will become clear.
By any chance no one has ported FANN to mql? http://leenissen.dk/fann/wp/download/, or similar code to mql with NS.
ZS: I can't find a ready-made NS by search and google, I plugged a .dll with FANN, it works pretty well, but I would like it without .dll.
By any chance no one has ported FANN to mql? http://leenissen.dk/fann/wp/download/, or similar code to mql with NS.
ZS: I can't find a ready-made NS by search and google, I plugged a .dll with FANN, it works pretty well, but I would like it without .dll.
It is better to train network in specialized software. It is much faster. And it is better to use it in code