Are there any additional runtime costs for calling overloaded methods?
I'm asking this specifically for Delphi , in case the answer isn't the same for all compiled languages.
I think there should be no additional cost since it should be resolved at compile time, but you can never be sure, can you?
Of course you can be sure, because it is documented . It's resolved by the compiler (at compile time, of course), so there's no additional cost associated with calling overloaded functions or methods in Delphi.
I've done a little experiment to prove it:
Result: Almost every time it takes 31 ticks (milliseconds) for both on my dev machine, some times it takes only 16 ticks .