Generating code in MQL5 takes so long time. can we do sth about it to make it faster? - page 2

 
Interesting. Why did you decide to change the code for this platform?
 
Fatemeh Ameri #: The main file is 1670 lines but it includes 16 mqh file, each of them 2500-3500 lines. It is a big project. It is a dashboard with so many options.

I don't have any project that big, so I can't comment much on the compile speed for that size.

 
Fernando Carreiro #:

Also, assuming you are using conditional compilation between MQL4 and MQL5, there could also be a big difference between the amount of code produced for MQL4 and that for MQL5, or that some part is convoluted or have some kind of compilation problems causing the issue, yet not being reported. An example would be missing braces or brackets but that are balanced, making the flow of the code strange but not report compilation errors. This is just a conjecture on my part.

EDIT: You could use a 3rd party preprocessor to create separate MQL4 and MQL5 source files, only for analysis, so you can compare them and see what the MetaEditor is actually processing and compiling.

Ok, How can I co that? I mean using " 3rd party preprocessor." Do you really think it can help?

(More explanation is, I originally create the MT4 version, then I convert the same code, meaning I changed the trading functions and objecting function which are different in MQL5 from MQL4, Now every thing seems to be working but testing and debugging the product is so hard because every time I change any thing I have to wait for 1.5 min for the code to compile)

 
bikoza #:
Interesting. Why did you decide to change the code for this platform?

Because it is a product, some people want the MT5 version.

 
Fatemeh Ameri #: Ok, How can I co that? I mean using " 3rd party preprocessor."

If you don't know about preprocessors then maybe it might make things more complicated for you.

Fatemeh Ameri #: Do you really think it can help?

I have no idea. Obviously I cannot see your code to be able to answer that objectively, so I was just speculating.

Fatemeh Ameri #: More explanation is, I originally create the MT4 version, then I convert the same code, meaning I changed the trading functions and objecting function which are different in MQL5 from MQL4, Now every thing seems to be working but testing and debugging the product is so hard because every time I change any thing I have to wait for 1.5 min for the code to compile

Are you using pure MQL5 functions for that or using something like MT4Orders library? If yes, then that will make the MQL5 version much more "heavy" than the MQL4 version.

 
Fernando Carreiro #:

If you don't know about preprocessors then maybe it might make things more complicated for you.

I have no idea. Obviously I cannot see your code to be able to answer that objectively, so I was just speculating.

Are you using pure MQL5 functions for that or using something like MT4Orders library? If yes, then that will make the MQL5 version much more "heavy" than the MQL4 version.

Thanks for all your response. 
I don't use library for classes, But I use library of objects to create dashboard. Can it be the source of heaviness?

 
Are you using resources?
 
Dominik Christian Egert #:
Are you using resources?

Yes, I use many bmp images in my dashboards. Can it be the cause of delay?

 
Fatemeh Ameri #:

Yes, I use many bmp images in my dashboards. Can it be the cause of delay?

Yes, for sure. - Put your resources into a shared library, this way you will have much faster compile times.

If you are interested, I have just published a shared project for error handling, which makes use fo a shared library. Also the code is considered a "all-in-one-place" header file, as you use one header and given defines to influence the way it is compiled.


Look for "MQLplus Enhanced Error Handler Library" as the shared binary library example, and for the actual project files, look for "MQLplus Include Library Collection".

 
I have also noticed the large time difference to compile between mt4 and mt5  
That said it is not a problem a few seconds versus 90 seconds is not that bigger a deal
But then I’m a patient man 😜 and back in the old days compiling took forever for most languages 
Work arounds will probably cost you more time in the long run 
Reason: