It also makes no sense to have a rule on the maximum number of lines for a function. These rules are often created by people who don't write software that needs to have high performance.
That is objectively false. Even though I agree with the spirit. For starters, unoptimized builds won't have that. Second, exceptions tend to inhibit inlining. Compare https://godbolt.org/z/c8Jayf with https://godbolt.org/z/Uoo2YA. Third, it's easy enough to push one of the heuristics used for inlining high enough in the wrong direction (e.g. function size). I recommend the clang optimizer view on godbolt.
Also note that it can be hard for a compiler to prove that a function is not used outside the current translation unit (although anonymous namespaces help with that). Number of calls is only one of the heuristics for inlining though anyway.
Compilers are plenty stupid, and have not earned blind trust.
How common is automated testing in AAA games?
Games that use automated tests often drive high level systems and test high level output. See for instance Riot Games's automated League of Legends test suite.
Almost everything taught in academia and in the enterprise about software development "best practices" are absolutely the wrong things for a game. (They're wrong for enterprise and academia, too, but I'm not willing to get into that fight on this site.)
- The function is exported to a library
- The code generator emitted an indirect branch instruction
- The inlined code exceeds the size of a single page in memory
- The inlined code does not perform as well because it is not i-cacheable
This rationalization doesn’t make sense to me, especially for game engines which I assume are not limited to a release or 2 but are used to power multiple titles. If the software artifact is going to live for a long time, it’s probably worth the effort to make it easier to understand and test.
Could this pattern result in code so slow the game won't work in development w/o high optimization flags, thus increasing compile time?
There may be other criteria, eg is the function likely to be called.