Download MetaTrader 5
To add comments, please log in or register
Do you want to deposit to your account? Do this in any convenient way!
Amir Yacoby
Amir Yacoby 2010.06.02 01:55 


I re-wrote a script from procedural to object oriented.

I noticed that a dll function call from the script (the import in the global scope) 

is much faster (about 5 seconds per call) than when calling the same function (less than a second)

from a class (the import is in the class global scope).

Is that so, and what is the fastest way to call a dll function from a class?

Does it matter in what scope the import statement is placed? (the class global scope, or some other) for performance? 



Ilyas 2010.06.02 16:54  


The speed of function call from DLL should not differ in both cases. Perhaps, this is caused by something else.

1. Tell us, what parameters has the imported function.
2. Check that the function is called with the same parameters.

Amir Yacoby
Amir Yacoby 2010.06.02 18:20  

thanks for the answer

1. the parameters are: int, double array (by reference), double array (by reference)

    the arrays are passed after ArrayResize is performed on them, both cases with the same size (19 for the first, 1 for the second).

2. the dll function called is the same, but there is a possibility for some other difference, seems low chance though but I will further check.

Thank you again 


To add comments, please log in or register