|
-
October 16th, 2009, 07:34 AM
#2
Re: Why not define all functions as inline?
 Originally Posted by amyahlom
This will save the time of passing arguments and return value (stack)
It is true that the code will have bigger size, but why care?
Why prefer inlining short function instead of long ones?
Thanks,
Ron
Really?
You had to ask in a forum?
I'm sure there are like 1000 articles explaining this.
The reason you want to keep your program small is not because of hard drive space. A big program will run slower than a smaller one, even with less jumps. A processor doesn't have much more than a few megs to store your program. If your executable is bigger than that, you will lose tons of time moving it from cache to ram.
Besides, function calls are not very expensive if you don't pass arguments by value.
Not to mention that a program where everything is inline will take years to compile, and you will create tons of dependencies.
There are tons of reason, too many to explain here. I highly recommend you try to find a good article about it. There too much to explain in a single post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|