2

This question is not at all related to this one When is a function name too long?

Can execution speed suffer because you have a function with a long name that is going to be repeatedly called from numerous places thousands of times? Do optimization flags take care of this in compiled languages so that there is no problem? Then what about interpreted languages like python?

Community
  • 1
  • 1
user1318806
  • 785
  • 3
  • 9
  • 13

1 Answers1

7

In (typical, static) compiled languages it doesn't matter at all, and has nothing to do with "optimization flags".

In such languages, the function names are strictly something used at compile-time to identify things. They are replaced with actual addresses (or offsets) in the final machine code. No name look-up occurs when you call a function in C.

unwind
  • 391,730
  • 64
  • 469
  • 606