Answer the question
In order to leave comments, you need to log in
I correctly understand that constants are the fastest?
I understand correctly that when the game is compiled, instead of constants (for example, "APP_ID = 4444"), he puts the value directly?
That is, the program / game does not need to go to the constant to look at its value, but the value is set directly during compilation?
Answer the question
In order to leave comments, you need to log in
No.
Modern compilers themselves are able to optimize.
And if you do not change the usual variable, it will also, with a high probability, behave like a constant.
But on average and in general - yes, as you think.
The above only applies to primitive/base types. With some dictionaries-arrays-trees - this will not work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question