none
Profile guided optimization with static libraries on 2008 RRS feed

  • Question

  • Hi all,

    We are currently using VS2005 with un-managed C++ code. Want to introduce profile guided optimization to our code base but I have read here http://msdn2.microsoft.com/en-us/library/aa289170.aspx that it does not support static libraries, we have a fair few of these so my question is, will this funtionality be available on 2008 edition of VS??

    Thanks

    Monday, January 28, 2008 9:51 AM

Answers

  • I think the restriction applies to code in the static libraries only. You can still take advantage of PGO, I just won't do anything to the code in the static libraries (unless you build with /GL). So do you want the code in your .libs to be optimized? Who uses these specific versions of your libs?

     

    I don't really know but I do not think that VC9 will allow you to inject profiling code and support feedback compilation for precompiled code inside static libraries.

     

    -hg

    Monday, January 28, 2008 11:51 AM

All replies

  • I think the restriction applies to code in the static libraries only. You can still take advantage of PGO, I just won't do anything to the code in the static libraries (unless you build with /GL). So do you want the code in your .libs to be optimized? Who uses these specific versions of your libs?

     

    I don't really know but I do not think that VC9 will allow you to inject profiling code and support feedback compilation for precompiled code inside static libraries.

     

    -hg

    Monday, January 28, 2008 11:51 AM
  • Hi,

     

    Thanks for your reply...

    Yes, we want to optimize everything throughout the code base - including the libraries. These are used by various apps in our system. None of the libraries are 3rd party so i'm confused as to why they cannot be optimized during compilation in the same way as DLLs...

     

    Chris

     

    Monday, January 28, 2008 11:59 AM
  • You could probably use PGO in that case, but that would require /GL. It's generally a bad idea to do with large libraries or if you need to share your code outside the project.

     

    Also training your code would always be for a given image file - not for the static .lib in general.

     

    -hg

    Monday, January 28, 2008 6:38 PM