By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,797 Members | 1,848 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,797 IT Pros & Developers. It's quick & easy.

Execution speed of overloaded functions

P: n/a
Hi,
Does function overloading affect the speed of execution of the program
?
If so what is the reason ?
How does it compare with a speed of a program using non-overloded
functions ?
Linny

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi

li*******@gmail.com wrote:
Hi,
Does function overloading affect the speed of execution of the program
?


Certainly not.

Markus

Jul 23 '05 #2

P: n/a
<li*******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi,
Does function overloading affect the speed of execution of the program
?
No. Why should it? Overloaded or not, the function will be translated to an
address, or inlined, or whatever. Any cost in resolving which function to
call is at compile time, not run-time.
If so what is the reason ?
N/A
How does it compare with a speed of a program using non-overloded
functions ?


The same.

DW

Jul 23 '05 #3

P: n/a
> Does function overloading affect the speed of execution of the program ?

No. Execution speed is not affected at all.
What may be affected is the speed of compilation.

If you provided over 3 trillion different functions all called foobar(), the
compiler might takes some time working out which version is a best match for
arguments provided.

Stephen Howe
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.