0

GCC9 compiler slower than GCC6? What is possible solution for the same?

Normally it was taking 5 minutes for compilation but now after upgrading to GCC9 it's taking 20 minutes for compilation.

Can anyone suggest the soultion?

  • 1
    how long it takes to compile depends to most part on your code. A factor of 4 for the same code is unusual, but the reason is most likely in your code – 463035818_is_not_an_ai Feb 26 '21 at 09:16
  • @largest_prime_is_463035818 for the same code with GCC6 it is taking less time and with GCC9 it is taking more time. not exactly factor of 4, point was time taken is more in GCC9 for same peice of code. What to do for that? – krishma_thakral Feb 26 '21 at 09:24
  • what is the code? Same settings of the compiler? – 463035818_is_not_an_ai Feb 26 '21 at 09:32
  • @largest_prime_is_463035818 yes same settings used – krishma_thakral Feb 26 '21 at 10:10
  • consider that "same settings" includes the defaults and they can change between versions, so "same settings" is not necessarily "exact same command used to invoke the compiler". Version of the standard is what comes to my mind first – 463035818_is_not_an_ai Feb 26 '21 at 10:24
  • As a compiler is developed optimization passes will be added/improved, so it's not surprising that there is some discrepancy (although a factor of 4 does seem excessive). It would be interesting to know how that discrepancy changes (if at all) with optimization level: i.e. moving in steps from `-O0` to `-O3`. – G.M. Feb 26 '21 at 10:30
  • You could use more parallelism when compiling the code. – Marc Glisse Feb 26 '21 at 13:19

0 Answers0