dcsimg
Results 1 to 17 of 17

Thread: [RESOLVED] Any way to speed up compile time?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Resolved [RESOLVED] Any way to speed up compile time?

    Just wondering if anyone knows of any tricks to speed up the compile process in VB 2008 Pro.

    I have been finding myself waiting on the compiler quite a bit over the course of my various projects.

    More specifically I am working on a Windows Mobile app and every time I click the run button I have to sit and wait on the IDE to compile the code for execution.
    This gets a bit annoying during the debugging phase. Make small change click run wait a good while, test then repeat.
    Sometimes it gets to the point that I feel like I am spending more time waiting on the compiler than I am coding.

    In the current project I now have 3 small classes and one form. total size of all of these files is 52kb with 27k of that being the designer and resx files for the form.
    During a test I got an error on a line that should have been removed but wasn't so I stopped the debugger, commented out the line and clicked run again to see if there were any other problems.
    This time I used a timer to time the compile time. 1 minute 10 seconds!

    That seems like a huge amount of time considering that it is such a small project and the PC running it is a 6core 3.3ghz Windows 7 with 8gb ram

    Any tricks I should know that may reduce this wait time?

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    hmm this is rather strange. I thought I had found something but now I have no idea what the deal is.

    Previously when I timed the compile it took 1m10s to complete.
    I found some tips online that said the minimal info on build was slower than using diagnostic so I changed it in the IDE
    I closed the project and reopened it made a small change and clicked run
    13s it took which is way better than 1m10s of course.
    So I changed the setting back and tried again
    13s again ... hmm

    I did not close and reopen the project this time so I do not know if that setting only applies to projects opened after changing it or what.
    Guess I'll try setting it back to what it was originally, close and reopen to see what happens.

    hmm do difference detected still 13s

    Tried several other things and after a few tries the compile time went from 13s to 35s

    Closed and reopened tested again 3 seconds back up to 13 after a few tries.

    Could it be that there is a memory leak somewhere in the debugger or complier that is causing it to get slower after multiple builds?
    Perhaps the answer is simply restarting the IDE when it gets to slow?

    More testing required.

    Anyone else notice this?

  3. #3
    PowerPoster
    Join Date
    Oct 2010
    Posts
    2,141

    Re: Any way to speed up compile time?

    Have you installed SP1 for VS2008? It has been a long time, but I seem to remember all sorts of issues that were corrected by SP1.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: Any way to speed up compile time?

    That's an absurd amount of time, as you assumed. A program of that size should take a second, or so, not a minute plus. Certainly try the service packs, but otherwise...something is messed up, as that is not normal.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    Thanks.

    I thought I had the service packs installed already but apparently not on this PC.
    Am downloading the iso for SP1 now, Will give it a try over the next few days and see how it goes.

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,889

    Re: Any way to speed up compile time?

    One thing to note is that, if the SP fixes the problem, you won't be able to say that it was a problem with the un-patched VS2008. There is an issue with your installation, and if installing the SP fixes the issue, it may be because of something bad that the SP fixed, or it may just be that the installation process resolved whatever the glitch was. In any case, the problem will go away, which is what really matters, but I'm pretty sure I used VS2008 prior to any SP release and didn't notice anything peculiar about compile times. They were always short.

    I also have a vague memory of somebody else encountering this in the last few years, not with VS2008. That issue was never resolved, either. It kind of comes down to: Try things until the problem goes away.

    At least you can be assured that it IS a problem and is not normal behavior.
    My usual boring signature: Nothing

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    Well.. now that I have thought about it a bit. This is not the only PC where this is happening. And if memory serves it was also an issue in VB2005.
    Currently I have 2008 running on two PCs one running XP and this one running Windows 7. I have saw the issue on both.

  8. #8
    PowerPoster
    Join Date
    Oct 2010
    Posts
    2,141

    Re: Any way to speed up compile time?

    Do you have any anti-virus running? I have had issues in the past with the AV occasionally causing problems. Avast was the worst offender for preventing the final copying of the executable the obj folder to the debug/release folder based on heuristic testing. Bitfender, if I recall correctly, would occasionally slow compile times; at least that was my perception as I only tried it for a short time and then went for another solution.

    So, I would recommend disabling your AV if it is easily done and see if that improves the situation.

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    I have installed SP1 and turned on the diagnostic info on the builds.
    It appears that this is the culprit
    Code:
    11171 ms  PlatformVerificationTask                   1 calls
    
    Build succeeded.
    
    Time Elapsed 00:00:11.26
    As you can see of the total 11:26 11:17 was on that one task

    The more detailed listing where that came from
    Code:
    Task Performance Summary:
            0 ms  CreateProperty                             1 calls
            0 ms  RemoveDuplicates                           2 calls
            0 ms  ReadLinesFromFile                          1 calls
            0 ms  FindAppConfigFile                          1 calls
            0 ms  Message                                    3 calls
            0 ms  AssignCulture                              1 calls
            0 ms  MakeDir                                    1 calls
            0 ms  AssignTargetPath                           5 calls
            0 ms  CreateVisualBasicManifestResourceName      1 calls
            0 ms  Delete                                     1 calls
            0 ms  GetFrameworkPath                           1 calls
            1 ms  GetDeviceFrameworkPath                     1 calls
            1 ms  ConvertToAbsolutePath                      1 calls
            1 ms  FindUnderPath                              5 calls
            1 ms  GenerateResource                           1 calls
            4 ms  Vbc                                        1 calls
            5 ms  ResolveAssemblyReference                   1 calls
            5 ms  Copy                                       8 calls
        11171 ms  PlatformVerificationTask                   1 calls
    So far I have not di a lot of changes to the project, I have maybe did 6 builds on it for testing, all of them but one were in the 11 second range the other was in the 23 second range but I did not have the diagnostics on at that point.

    I will leave the diagnostics on and pay attention. If I get another case where the build slows down like it did yesterday then maybe there will be more of a clue in that log.

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    I think Maybe I stumbled upon a solution. Haven't tried it yet but it sounds promising
    https://blogs.msdn.microsoft.com/vsd...fication-task/

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    hmm.

    Well I tried doing as directed in the link above but it did not seem to make any difference. One thing though about that was that the file was not in the location the link states and was under the v3.5 folder rather than the 2.0.xxx Filename was same, content was same. Made change did not notice any differences.

    Found another link that showed how to disable the PVT in a project file so I tried that and tested again. Still no difference that I could tell.
    Perhaps I did something wrong but I think I did it correctly. I was really hoping to get rid of that extra 11 seconds +

    Apparently this issue only shows when building mobile apps.

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    Well it appears that the issue is somehow related to the form designer.
    What i have saw is that if I have opened a form in design mode it slows down the compile. It does not seem to matter if you close the form once opened. It also seems to slow down more over time and multiple runs.
    I also noticed that if you close the form designers and exit VS then load it back up without opening any form in design mode that it goes much faster, about 2 seconds to compile my current project vs 11 if the designer has been opened and 22 seconds if you have did a few runs while in that session or up to over a minute after a while.

    I am going to experiment with having two copies of the IDE open one with the project open but all forms closed to use for building and the other with the forms open for editing. Will see if that works.

  13. #13
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,793

    Re: Any way to speed up compile time?

    First thoughts on hearing that - I wonder if it's a custom control or component that's "running" in the background when you open the form in design mode... and then when you go to do the build, the IDE is "fighting" the running code or has to wait until it's done before it can really do it's thing.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    Nothing special on the form just some panels, labels, buttons and text boxes
    It seems that the PlatformVerificationTask takes all the additional time.
    I saw that this could be disabled but either that doesn't work in 2008 or it does not apply to mobile apps.

    It really makes no sense for it to take that long to do so but if a form is open and any change has been made to the code or the form then the longer compile times.

    At least I know now that when the compile times get to high restarting the IDE will help a lot.
    Last edited by DataMiser; Jan 18th, 2017 at 12:29 PM.

  15. #15
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,793

    Re: Any way to speed up compile time?

    a quick Google Search for PlatformVerificationTask turns up a lot of results complaining about the long compile... and in every case it seems related to mobile development. Not sure if any of them contain a solution, but there's plenty to complain, I mean talk about.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: Any way to speed up compile time?

    Yeah, I looked at several of them after I first posted and thought they had the answer but no luck.
    The one that seems it may work is to use two instances of the IDE one that has the project open but no forms or code open and another to do the editing and saving. According to one user this allows you to compile from the one where nothing is open and avoid the slow compile times. I have not tried it yet myself but seems like it may be a work around that could do the job.

  17. #17

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,143

    Re: [RESOLVED] Any way to speed up compile time?

    Ok after lots of testing I think I found a work around that is somewhat suitable. The second copy of the IDE did not seem to help much so that is out.

    What I noticed was as follows

    If I open the project with no code or designers visible then open a code window, make changes then compile it takes roughly 2 seconds
    If I open a form designer and make no changes in the designer but change some code it takes roughly 10-15 seconds to compile
    If I open the form designer and make changes to the form then it takes 40 seconds or more to compile.

    If after having made changes to the form via the designer I close the designer window it makes no difference
    If after closing the designer window I exit VB then reload where the window is closed and do not open it then we are back to 2 seconds on the compile.

    So the workaround is to close the designer, save and restart the IDE after making changes to the form via the designer.
    Kind of a pain but when debugging there is rarely any design changes that need to be made yet often there can be lots of code changes and restarts required to iron out little odds and ends.
    In the long run it should save a lot of time and aggravation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width