efficiency of user-defined functions
I wouldnt do this. Stick to functions and writing good code.
In some tests I did calling an empty function 5,000,000 times added about 3.5 seconds to the execution speed.
That is a function call (with no parameters) took less than a millionth of a second. This was on a VM running on a fairly old host machine. (Q6600)
I wouldnt do this. Stick to functions and writing good code.
In some tests I did calling an empty function 5,000,000 times added about 3.5 seconds to the execution speed.
That is a function call (with no parameters) took less than a millionth of a second. This was on a VM running on a fairly old host machine. (Q6600)
ah nice work, thanks :]
I think somewhere in "The Book" if says having user defined functions is slightly less efficient (but much clearer to read and program). I'm wondering if I can use user defined functions while writing the EA, and then, when it's time to compile, copy and paste each function in place of the function call - inside the Start function. Has anyone tested if this is noticeably faster?
To my mind there are two possibilities:
1) The program flows in a linear way and each function is called only once in turn, and then finishing the Start function.. something like this:
My guess is... copying and pasting in the functions here definitely wouldn't INCREASE working time.. and might decrease it a little.
2) but then the other kind is less linear, or where you might have to copy in the same function in multiple places, e.g.:
Do you think copying in the code for Analyse() three times might make the EA a little slower?