Do long variable/function names affect EA speed after compilation?

 

First post here, hi everyone!

I've always been worried that really long variable and function names would affect my EA's speed so I got into the habbit of renaming inputs like this:

input bool MAKE_THE_EA_DO_A_INSTEAD_OF_B_WHEN_X_HAPPENS = true;
bool DO_A = MAKE_THE_EA_DO_A_INSTEAD_OF_B_WHEN_X_HAPPENS;

But I don't know if that changes anything after compiling the code...

Now I realize that it's causing issues when I change input parameters as the input change isn't being seen by the short-name var on re-init. So I have to create an extra step like this:

input bool MAKE_THE_EA_DO_A_INSTEAD_OF_B_WHEN_X_HAPPENS = true;
bool DO_A;

int OnInit() {
        DO_A = MAKE_THE_EA_DO_A_INSTEAD_OF_B_WHEN_X_HAPPENS;
}

Now it works as intended: if I change the input settings, the new values get passed to the short-name vars correctly even if the EA is live.

But is all of this supposed to have an impact of the EA's efficiency or am I just wasting time with useless code? Because if none of this matters after compiling the code then there's no reason to be doing any of this going forward.

If any of you know what happens to the variable and function names once you compile the MQL5 code I would like to know if the length of the names in the source code matters for the compiled version. If the names are shorter, does it use less CPU, does it get processed faster?

Thanks

 
Jeepack:

First post here, hi everyone!

I've always been worried that really long variable and function names would affect my EA's speed so I got into the habbit of renaming inputs like this:

But I don't know if that changes anything after compiling the code...

Now I realize that it's causing issues when I change input parameters as the input change isn't being seen by the short-name var on re-init. So I have to create an extra step like this:

Now it works as intended: if I change the input settings, the new values get passed to the short-name vars correctly even if the EA is live.

But is all of this supposed to have an impact of the EA's efficiency or am I just wasting time with useless code? Because if none of this matters after compiling the code then there's no reason to be doing any of this going forward.

If any of you know what happens to the variable and function names once you compile the MQL5 code I would like to know if the length of the names in the source code matters for the compiled version. If the names are shorter, does it use less CPU, does it get processed faster?

Thanks

MQL is a compiled language. not an interpreted language. The length of a variable/function name is irrelevant at execution time.

 
Fernando Carreiro #:

MQL is a compiled language. not an interpreted language. The length of a variable/function name is irrelevant at execution time.

Thanks Fernando,

I'm not familiar with the way compiled languages work (compared to interpreted languages) so your input is what I needed!

Cheers!

Reason: