Do built-in functions have any effect on performance?

With modern compilers, does the inline function declare any performance impact anymore?

That is, when faced with the option to define the inline function in the header or in the source file, is there a difference between the two?

In this SO question When to use a built-in function and when not to use it? The accepted answer gives several reasons.

Exposure:

to do:

  • very small functions are good candidates for inline : faster code and smaller executables (more likely to stay in the code cache)
  • the function is very small and very often

not

  • large functions: leads to large executable files, which significantly degrades performance regardless of the faster execution that occurs due to overhead

Advice from 7 years ago, and I read that these days the embedded word is ignored, and the compiler decides what to do in the line.

Questions:

  • Is the above advice still relevant?
  • To what extent does the definition of an inline function have any effect (other than preventing multiple problems with definition builders)?
  • What are the reasons why I have to embed a function these days?
+8
c ++ inline
source share

No one has answered this question yet.

See similar questions:

164
When to use the built-in function and when not to use it?
72
Is there any other option for inline?

or similar:

1518
Image Processing: Enhanced Coca-Cola Can Recognition Algorithm
1406
Why does 0.1f to 0 slow down performance by 10x?
1250
Replacing a 32-bit loop counter with 64-bit values ​​results in crazy performance deviations
484
When should I write the keyword 'inline' for a function / method?
95
Does it make sense to use the built-in keyword with templates?
34
What is wrong with the built-in functions?
14
Is there a difference in embedding functions with a compiler or linker?
eleven
Why is this not cost-effective for inline functions using loops or switch statements?
3
requirement for a function to be inline in C ++
2
Built-in function

All Articles