Testing the new MQL5 compiler for x64 platforms - 2 to 10 times faster calculations! - page 2

 
Yury Kulikov:
For example, inter-terminal communications.

Well, if you twist it like that, then of course, the DLL is a useful feature...

But I personally for this very task decided that I don't really need a DLL for that. Right now I'm thinking about an EA that would take quotes from one brokerage company and send signals to another one, and that does not even have MetaTrader. (DucaCopi, by the way, I wonder if MetaQuotes will agree with this venerable broker ?).

Was thinking in the direction of DLL. But decided that shared files are much safer and more reasonable. Let MetaTrader write signals to the file. And let another MetaTrader (or JForex or someone else) read and execute them.

 

By the way, I've been thinking about array references...

Renat, I make a suggestion:

Since we have a Standard Library, shouldn't we add a variant of OnCalculate() function with the following prototype:

intOnCalculate(constint rates_total,//size of input timeseries
constint prev_calculated,// bars processed at previous call
const CiTime* ptTime,// Time
const CiOpen* poOpen,// Open
const CiHigh* phHigh,// High
const CiLow* plLow,// Low
const CiClose* pcClose,// Close
const CiTickVolume* ptvTickVolume,// Tick Volume
const CiRealVolume* prvRealVolume,// Real Volume
const CiSpread* psSpread// Spread
);

?

In my opinion, this would require very small changes in MetaTrader, but on the other hand it simply provides pointers to arrays, which can be passed to handler classes without copying. And the idea of the Standard Library itself is popularized.

 

Got first results of comparing performance of old and new compiler on example of real big project (~20,000 lines of source code).

Results of running time of program compiled with old version of compiler (4 runs):

2015.05.02 13:48:46.641 *** (EURUSD,D1)       Start ***. Parsing of history deals (22575) and orders (22656) completed in 6.443 sec. 116 MB RAM used.
2015.05.02 13:48:27.879 *** (EURUSD,D1)       Start ***. Parsing of history deals (22575) and orders (22656) completed in 6.427 sec. 116 MB RAM used.
2015.05.02 13:48:12.067 *** (EURUSD,D1)       Start ***. Parsing of history deals (22575) and orders (22656) completed in 6.287 sec. 116 MB RAM used.
2015.05.02 13:47:49.719 *** (EURUSD,D1)       Start ***. Parsing of history deals (22575) and orders (22656) completed in 8.751 sec. 116 MB RAM used.

Running time results for a program compiled in the new compiler version (4 runs):

2015.05.02 13:54:18.638 *** (EURUSD,D1) Start ***. Parsing of history deals (22575) and orders (22656) completed in 5.475 sec. 116 MB RAM used.
2015.05.02 13:54:01.995 *** (EURUSD,D1) Start ***. Parsing of history deals (22575) and orders (22656) completed in 5.616 sec. 116 MB RAM used.
2015.05.02 13:53:43.853 *** (EURUSD,D1) Start ***. Parsing of history deals (22575) and orders (22656) completed in 5.444 sec. 116 MB RAM used.
2015.05.02 13:53:25.809 *** (EURUSD,D1) Start ***. Parsing of history deals (22575) and orders (22656) completed in 6.147 sec. 116 MB RAM used.

*The second and next runs of the program were carried out with warmed cache - as it is seen the warmed cache increases productivity on 15-30%.

As you can see the results are better in the new compiler: it took ~6.4 seconds to parse over 20000 deals and orders in the first run and ~5.4 seconds in the second one, i.e. the performance gain of 15-20%.

The performance improvement could have been greater, but most of the time is taken up by system function calls.

 

The new compiler detected no errors in the project, totaling more than 20,000 lines of source code. This is an excellent result, taking into account that this project was created for the old version of the compiler.

However, the new compiler generated several warning messages related to incorrect display of file paths (slash escaping requirement):

This is a fair requirement, which can easily be met with a few minor modifications.

Thus, we can conclude that even large projects written in MQL5 are ready for the new compiler and switching to it will not be a problem for professional developers.

 
Sergey Eremin:
...
I get"code generation error 1 1".

...

I also get this error.
 
The main gain is in the maths and your own calculations.

If the bulk of the hard work is in system calls, the acceleration will be small.
 
Renat Fatkhullin:
The main gain is on mathematics and own calculations.

If the bulk of the hard work is in system calls, the acceleration will be small.

It is still good, because you can create your own environment with minimal system function calls.

(copying the environment once in your classes and working with it directly).

 
George Merts:

Well, if you twist it like that, then of course, the DLL is a useful feature...

But I personally for this very task decided that I don't really need a DLL for that. Right now I'm thinking about an EA that would take quotes from one brokerage company and send signals to another one, and that does not even have MetaTrader. (DucaCopi, by the way, I wonder if MetaQuotes will agree with this venerable broker ?).

Thought about dll. But I've decided it's safer and more sensible to use shared files. Let MetaTrader write signals to the file. And another MetaTrader (or JForex, or someone else) - let them read and execute.

There is an option with named channels, but there is a need for an intermediate server,

There are examples of how to do this on the forum.

 
Yury Kulikov:
For example, interterminal communications.

Alexandr Bryzgalov:

There is an option with named channels, but you need an intermediate server,

There are examples of how to do this on the forum.

No need any named channels! Looking forward to adding SQL support. Exchanging data through a table. SQL is a built-in support for multi-threaded, high-burden systems.
 
Vasiliy Sokolov:

No need for any named channels! Waiting to add SQL support. Exchange data via a table. SQL is a built-in support for multi-threaded high load systems.
I was just talking about what we have and if we add sql we can talk about it too )
Reason: