By Brandon Hewitt
1. Instrumenting the application to output profiling data is just going to naturally add time. You have all this I/O as the application writes this runtime data to a file as it runs.
2. The compiler disables many optimizations when creating this instrumented application. Inlining for example, needs to be completely disabled if you’re going to get any accurate sense of the functions being called either for code coverage or for profile-guided optimizations.
Now, runtime of these instrumented applications are usually not nearly as important as the runtime of the optimized application since the instrumented application is used in more one-off situations for programmer/build reasons (either once to get the code coverage data, or periodically to generate profiling data for PGO). Even so, there is likely some threshold where the run time of the instrumented application would become inconvenient and eventually untenable. If anyone has specific feedback here, comments would be welcome.