c++ - Should I use a function in a situation where it would be called an extreme number of times? -


I have a section of my program that has a large amount of mathematical calculations with some large equations, its long and crappy I want to change it with a function, however, the code part is used very often in my code and they require many variables to get started.

If I'm concerned about speed, then what is the function to call the function and the variable is negligible or should I do direct coding at all times?

Thanks, / P>

- Fine

Mostly compiler upper Wondering about inline a lot of small functions to avoid. The function call function is too large that the compiler will not inline them, the overhead for the call is possibly a very small fraction of the total execution time.

To understand this specific approach, see your compiler documentation.

Either way, paste from the functions and keep your code clean.

Some old compilers may be useful or indicated by the signal that the function is a candidate for inlining.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -