Tech Off Thread

50 posts

VS 2008 build time increased by factor of 50 over VS2005

Back to Forum: Tech Off
  • User profile image
    bozito

    I just started using VS2008 and build time just went to hell in a handbasket.  I am referring to when I deploy the application.  No matter if it is to the emulator or a device (it is a Windows Mobile app), the initial build phase went from a few seconds to several minutes.  I am thinking that VS2008 rebuilds all, even those components that are not out of date, whereas VS2005 only rebuilt the out-of-date components.  Is this the default behavior of VS2008, and is there a way to fix it?  

  • User profile image
    JChung2006

    It sounds like something happened during the 2005-to-2008 migration that is causing the precompilation headers to be touched for every compilation or perhaps the .pch file isn't being generated at all.

  • User profile image
    figuerres

    bozito wrote:
    I just started using VS2008 and build time just went to hell in a handbasket.  I am referring to when I deploy the application.  No matter if it is to the emulator or a device (it is a Windows Mobile app), the initial build phase went from a few seconds to several minutes.  I am thinking that VS2008 rebuilds all, even those components that are not out of date, whereas VS2005 only rebuilt the out-of-date components.  Is this the default behavior of VS2008, and is there a way to fix it?  


    Hmm... I have two mobile apps, one is done and the other is in-progress.

    build times and deploy times seem to be the same as other versions of VS.

    now I did not copy the old sln file to 08, I just created a new .sln and have been copying bits of code from my older app as I am re-working a lot of the details.

    perhaps you have some dep. in the code on some thing that is messing it up ??

    what happens if you make a new .sln and copy in the code and build that ?  slow? fast?

    is it the "Build" that is slow or the "Deploy"
    I have always seen "deploy" as slow compared to "build"

  • User profile image
    numedia

    There is a known issue in VS 2008 that will affect build performance. Try going into your project properties under the Compile tab and turn off Generate XML documentation file. This was an issue i ran across and that was the solution. This may or may not also be your problem.

  • User profile image
    evildictait​or

    numedia wrote:
    There is a known issue in VS 2008 that will affect build performance. Try going into your project properties under the Compile tab and turn off Generate XML documentation file. This was an issue i ran across and that was the solution. This may or may not also be your problem.


    Just to clarify, this is a known issue for VS 2008 for Visual Basic programs only.

  • User profile image
    bozito

    Sorry, I started this thread and was soon after assigned to another project for awhile and didn't have a chance to get back to  this until now.

    My project is a VB project and it has no .pch files to the best of my knowledge.

    In reply to the person who mentioned changing the Compile option for generating the XML documention file, it  is has never been selected, so that isn't the answer.  But it wouldn't be the answer to why it rebuilds everything in the project when only one file has been touched anyway.

    Actually, it rebuilds everything on deployment when nothing has been touched!  I occasionally try to deploy to either the PocketPC device or to the emulator without stopping the application before deploying.  This causes a deploy failure, reasonably enough, and I have to close the app and re-deploy.  But it then takes five mintues of re-building before it starts to deploy.  Very, very annoying!

    In reply to the person who suggested starting over from scratch and building a new solution, rather than using the migrated solution, I haven't done it yet but I will try that next.  If that solves the problem, then there is a bug in the solution porting process.  Am I the only person to experience this?


  • User profile image
    figuerres

    bozito wrote:
    Sorry, I started this thread and was soon after assigned to another project for awhile and didn't have a chance to get back to  this until now.

    My project is a VB project and it has no .pch files to the best of my knowledge.

    In reply to the person who mentioned changing the Compile option for generating the XML documention file, it  is has never been selected, so that isn't the answer.  But it wouldn't be the answer to why it rebuilds everything in the project when only one file has been touched anyway.

    Actually, it rebuilds everything on deployment when nothing has been touched!  I occasionally try to deploy to either the PocketPC device or to the emulator without stopping the application before deploying.  This causes a deploy failure, reasonably enough, and I have to close the app and re-deploy.  But it then takes five mintues of re-building before it starts to deploy.  Very, very annoying!

    In reply to the person who suggested starting over from scratch and building a new solution, rather than using the migrated solution, I haven't done it yet but I will try that next.  If that solves the problem, then there is a bug in the solution porting process.  Am I the only person to experience this?



    how is the solution structured ?

    for example is this one project with all the code in one sln ?

    what are the number of forms? classes? other items?

    if for example you have classes that do not chnage and are in one project you might want to move them to a seperate class library project in the same solution.

    also *if* you have multiple projects that build a solution what are the build dependancyies like ??

    if none are listed the build system might be doing "make all" so to speak.
    if you can work out what depends on what and tell VS this it might not have to spend as much time on stuff.

  • User profile image
    bozito

    There is only one project in the solution and that project has about 15 forms and no other classes. 

    However, as I look though the project directory I am now grasping the fact that VB doesn't create obj files or any analog thereof.  So it needs to process through all the source to build the executable.  So what remains a mystery is why does it rebuid every time I redeploy, even when I haven't changed anything.  That just seems wrong.   Also, VS2005 was many times faster at building an executable than VS2008.   Five minutes to buld an executable from 15 forms?  That seems pretty horrible to me.  Or am I expecting too much?




  • User profile image
    bozito

    Well, I was wrong about one thing.  I was estimating the time at 5 minutes.   But I just timed it and it is 8 minutes!

  • User profile image
    figuerres

    bozito wrote:
    There is only one project in the solution and that project has about 15 forms and no other classes. 

    However, as I look though the project directory I am now grasping the fact that VB doesn't create obj files or any analog thereof.  So it needs to process through all the source to build the executable.  So what remains a mystery is why does it rebuid every time I redeploy, even when I haven't changed anything.  That just seems wrong.   Also, VS2005 was many times faster at building an executable than VS2008.   Five minutes to buld an executable from 15 forms?  That seems pretty horrible to me.  Or am I expecting too much?






    it seems to long to me also but there are a lot of details I can not "see"

    one thing you could do is lookup some of the dev-div folks and ask them about it.

    also I did mention seperation of some of the logic...
    if there is a bunch of code in the forms or in other classes move some of that into a class project you can build seperate.

    that does not answer the "why so long" question directly but would have several benefits like making the UI and the logic less directly coupled to each other.  and you could time the build of the dll seperate from the build of the UI and see which of the two takes more time.

    I have a device solution with several dll projects and while I have not timed it I do not think it takes anything like 5-8 minutes to run a build.

    by the way:  are you timing a "debug" wich it a build and then a deploy or are you timing a "build"?

    I have always found that the "debug" build +deploy takes long and half of that time is just the way it sends the files to the device and gets "hooked up" for a debug session.

  • User profile image
    PerfectPhase

    have you turned the msbuild logging up to normal or above?  That has timings so you can see whats causing the problem.

    Post it here so we can have a look.

  • User profile image
    bozito

    Thanks for the advice.  This is my first time creating a VB app (or any other kind  of app using Visual Studio) so there is a bit I will have to research to follow your suggestion.  I have never built a class library or separted code from the forms, for example. 

    When you ask if I am timing a Debug build, if you mean am I selecting Start Debugging from the Debug menu, the answer is no.  I am simply selecting Deploy from the Build menu, which triggers a build and deploy.   Is there some setting that I missed that turns on debug building?  That would explain a lot, like why it rebuilds every time I deploy, even if I haven't changed anything.   Or is that the standard behavior?  Hard to believe that anyone would have designed it that way intentionally.


    figuerres wrote:
    
    bozito wrote:
    There is only one project in the solution and that project has about 15 forms and no other classes. 

    However, as I look though the project directory I am now grasping the fact that VB doesn't create obj files or any analog thereof.  So it needs to process through all the source to build the executable.  So what remains a mystery is why does it rebuid every time I redeploy, even when I haven't changed anything.  That just seems wrong.   Also, VS2005 was many times faster at building an executable than VS2008.   Five minutes to buld an executable from 15 forms?  That seems pretty horrible to me.  Or am I expecting too much?






    it seems to long to me also but there are a lot of details I can not "see"

    one thing you could do is lookup some of the dev-div folks and ask them about it.

    also I did mention seperation of some of the logic...
    if there is a bunch of code in the forms or in other classes move some of that into a class project you can build seperate.

    that does not answer the "why so long" question directly but would have several benefits like making the UI and the logic less directly coupled to each other.  and you could time the build of the dll seperate from the build of the UI and see which of the two takes more time.

    I have a device solution with several dll projects and while I have not timed it I do not think it takes anything like 5-8 minutes to run a build.

    by the way:  are you timing a "debug" wich it a build and then a deploy or are you timing a "build"?

    I have always found that the "debug" build +deploy takes long and half of that time is just the way it sends the files to the device and gets "hooked up" for a debug session.

  • User profile image
    bozito

    PerfectPhase wrote:
    have you turned the msbuild logging up to normal or above?  That has timings so you can see whats causing the problem.

    Post it here so we can have a look.


    Where to I find that option?  I don't see it in Project Properties or in Tools>Options or in the Advanced Build Options.   And looking through my project folder hierarchy, I don't see any log files. 

  • User profile image
    bozito

    bozito wrote:
    
    PerfectPhase wrote:
    have you turned the msbuild logging up to normal or above?  That has timings so you can see whats causing the problem.

    Post it here so we can have a look.


    Where to I find that option?  I don't see it in Project Properties or in Tools>Options or in the Advanced Build Options.   And looking through my project folder hierarchy, I don't see any log files. 


    I meant the Configuration Manager, which appeared under the Build menu after I chose Show Advanced Build Configurations in Tools>Options>Projects and solutions.  Still haven't found the msbuild logging option.

  • User profile image
    PerfectPhase

    Tools->Options->Projects & Solutions->Build & Run->MSBuild project build output verbosity.  Output in the output window.

  • User profile image
    bozito

    PerfectPhase wrote:
    Tools->Options->Projects & Solutions->Build & Run->MSBuild project build output verbosity.  Output in the output window.


    In VS2008????  There is no such entry in Projects & Solutions on my machine!   On my system, P&S contains three places to enter some Visual Studio locations and 8 check boxes, none of which contain anything to do with build options other than one to show Advanced build configurations and one to show Output window when build starts.

    I don't see a way to post an image here, but I can send you a screen grab if you want. 

  • User profile image
    figuerres

    bozito wrote:
    
    PerfectPhase wrote:
    Tools->Options->Projects & Solutions->Build & Run->MSBuild project build output verbosity.  Output in the output window.


    In VS2008????  There is no such entry in Projects & Solutions on my machine!   On my system, P&S contains three places to enter some Visual Studio locations and 8 check boxes, none of which contain anything to do with build options other than one to show Advanced build configurations and one to show Output window when build starts.

    I don't see a way to post an image here, but I can send you a screen grab if you want. 


    it's in VS 2008 Pro on my laptop.

    do you have pro or std ed?

  • User profile image
    bozito

    bozito wrote:
    
    PerfectPhase wrote:
    Tools->Options->Projects & Solutions->Build & Run->MSBuild project build output verbosity.  Output in the output window.


    In VS2008????  There is no such entry in Projects & Solutions on my machine!   On my system, P&S contains three places to enter some Visual Studio locations and 8 check boxes, none of which contain anything to do with build options other than one to show Advanced build configurations and one to show Output window when build starts.

    I don't see a way to post an image here, but I can send you a screen grab if you want. 


    And just to be a little bit clearer, expanding Projects and Solutions on the left side of the tab, shows General and VB Defaults.  The controls I described are in the General tab. In the VB defaults tab are controls for  Option Implicit, Option Strict, Option Compare, and Option Infer.

    No Build and Run.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.