Now, even though this line of the code is not supposed to be executed at run-time, the actual time of execution is significantly higher (Optimization time jumps nearly 2x !) in presence of such instruction vs. just simply "commenting out" the line calling a function.
I have just checked it with a print statement: the function does NOT get executed.
If you comment out the function call, then that function's code is not included in the DLL that's compiled from the PowerLanguage code. I suppose that if you go to the folder in which those DLLs are stored, the DLL file size differs whether that function is included or not (by commenting it out or not). (That folder is named 'Dlls' and is located in 'C:\ProgramData\TS Support\MultiCharts64\StudyServer\Studies\Dlls' for MultiCharts 64-bit).
What complication mode do you use for your script; 'fast execution' or 'fast compilation'? For 'fast execution' the DLL compiled from the PowerLanguage code should (
in theory) be as small and slim as possible. For 'fast compilation' the DLL will contain additional information/overhead more suited for debugging purposes (and should,
in theory, give slightly less good performance when the script runs). (This is based on my understanding; not a fact of how MultiCharts operates).
I agree with you Zheka that the script's execution time shouldn't differ when that function isn't called. But if the 'fast compilation' mode is used, I'm a bit more understanding of the speed difference.