The only thing I know about is that (2.) can make the code faster.
Could be an operational word. Built-in functions can speed up certain code codes, yes.
But the built-in function puts additional pressure on the instruction cache on most modern processors. If your function is too large to be installed in the L1 cache, it may work more slowly than making a function call (for which the CPU can optimize by pre-programming the function and its return site).
Embedding a function can also lead to excessive pressure on the L2 cache - if the built-in function is used an unusually large number of times, an additional code size increases the likelihood of misses in the cache, which leads to long delays and pipeline outages, as the CPU squeezes the thumbs while waiting for the memory bus will do something.
inline far from a silver bullet. Compilers with aggressive optimizations completely ignore the inline hint, because instead they will choose heuristic-based inline functions, such as code size or the presence of branches, regardless of the presence or absence of the inline .
The only thing I know is that (1.) increases the connection, which is bad.
This is what I have never heard. โLinkingโ is a concept that I only heard when describing high-level code relationships. It is rather a problem of maintainability and commonality of the code. inline - the problem of generating low-level code.
Regarding templates, again, an aggressively optimizing compiler will be built in if its heuristics demonstrate an advantage for this.
However, there is a link level problem: you may need to declare a function or template inline (or static , depending on the situation) to eliminate duplicate characters during the link or limit the visibility of characters. This, of course, is not an optimization.
In general, do not bother using the inline keyword unless necessary.