0

I have an exe containing Fortran and C++ code that was recently modified to link against some custom static libraries. The exe now runs significantly slower (~ factor of 2) than before in every function, even though it is not calling any new code in the test run. The call graph and function hit count has been checked in a profiler and validates the assertion that the new code is not being called.

At link time there are now numerous "multiple definition" warnings caused by the new code. However, optimisations are still enabled and no other compiler or environment settings have been modified. The exe is not significantly larger than before and the memory footprint is the same in both runs.

Any ideas what might cause this?

greenback
  • 1,506
  • 2
  • 17
  • 29

1 Answers1

0

The problem was caused by a spiralling chain of includes with optimizations inadvertently switched off in certain modules further down the call chain. Having no optimizations in these modules was of no consequence until the headers were linked, which is a performance-critical section of the code. The optimized module that used to include these headers no longer does due to changes in build order.

greenback
  • 1,506
  • 2
  • 17
  • 29