Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) First compile hangs VS (Read 7223 times)
bitNine
Junior Member
**
Offline


Posts: 13
Joined: Oct 2nd, 2015
First compile hangs VS
Apr 5th, 2016 at 6:07pm
Print Post  
I don't understand this issue, but it happens on both of my computers where I use VS and Arduino plugin. This is specific to VS2015. I am running the latest version of the plugin, which was updated today. (I can't remember how to find plugin version number)

Basically when I switch between debug and release, or switch to another computer where there have been significant enough changes since the last build, or sometimes it will do it EVERY time I build the debug version, VS hangs and it will take over 30 seconds to compile what usually takes about a second.

Quote:
Compiling debug version of 'Project' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Tutorial mode is Off.
Program size: 102,020 bytes (used 40% of a 253,952 byte maximum) (32.91 secs)
Minimum Memory Usage: 4097 bytes (50% of a 8192 byte maximum)


But if I build it again, I get this:

Quote:
Compiling debug version of 'Project' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Program size: 102,020 bytes (used 40% of a 253,952 byte maximum) (0.90 secs)
Minimum Memory Usage: 4097 bytes (50% of a 8192 byte maximum)


Which is more what I expect.

While this is happening, VS will hang 100%. Can't make any changes to code. Can't look at other menus. Can't cancel the build. It's frustrating to have to wait 30 seconds for it to compile. I also notice that this happens more often in Debug than it does in Release. It was so bad at one point that I was finding that it took me less time to debug in release mode than in debug mode because I didn't have to wait 30 seconds each time I would compile.

For the record, both of my machines are extremely beefy. No messing around here. i7 6-core processors, and LOTS of memory. I don't have these issues compiling any of my .Net apps.

Any ideas?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First compile hangs VS
Reply #1 - Apr 5th, 2016 at 6:14pm
Print Post  
Hi,

It's not hanging but detecting changes and recompiling. Obviously for a new project it is a full compile.

If you switch in "Visual Micro>Verbose Messages" you will see what it is doing so it won't appear to pause for 30 seconds.

I am also running an i7 and as an example a full compile for the Arduino Zero takes 6.8 seconds. 

It might be that your temp folder is on a slow drive or that the virus checker is interfering however I have only heard of 2 other users who had and solved that issue?

Q's

Which hardware are you using? 
Is 30 seconds for any empty project?

Tip: If you have complex libraries then switch off "Visual Micro>Deep Search Includes"
« Last Edit: Apr 5th, 2016 at 6:15pm by Tim@Visual Micro »  
Back to top
IP Logged
 
bitNine
Junior Member
**
Offline


Posts: 13
Joined: Oct 2nd, 2015
Re: First compile hangs VS
Reply #2 - Apr 5th, 2016 at 9:29pm
Print Post  
For the record, everything is on a SSD (500MB/sec read 400MB/sec write) on both computers, and virus software does not exist.

I just turned on verbose messages and it still hangs, but I am seeing the hang between two compile events. It is related to the u8g display library. It hangs between compiling u8g_font_data.c.o and u8g_line.c.o. I'm just not sure if the print to the output is occurring before or after the command is executed. I'm going to assume it's the u8g_font_data.c.o file because it's almost 1.4MB, compared to most other files that are just a few KB. But when I run that compile command on its own, that's only about 5 seconds. Without the verbose messaging, VS locks up for almost the entire compile process.

Turning off deep search includes increased compile time by a few seconds.

I guess I just have to accept that I'm working with a lot of code.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First compile hangs VS
Reply #3 - Apr 5th, 2016 at 9:42pm
Print Post  
Turning off deep search includes is only slower the first time you compile because it clears the compiler cache. It can't take longer than deep search under normal usage.

What you have said is that when the cache is cleared and the entire core has to be recompiled it is only a few seconds longer so this suggests your disk is working well.

If u8g_font_data is part of a library then I would be keen to know the compile time with deep search switched off (2nd compile after changing the setting)

I just noticed the size of your program. 102,000. That's big. It is probably the tool chain that is pausing because visual micro just runs the verbose output that you see. It might be the tool chain is taking time to release itself when compiling such large files. One Visual micro change on the horizon is to launch separate threads for the compilation so the delay waiting for the release won't be noticeable, current the ui thread is blocked until each gcc/g++ command completes.

  
Back to top
IP Logged
 
bitNine
Junior Member
**
Offline


Posts: 13
Joined: Oct 2nd, 2015
Re: First compile hangs VS
Reply #4 - Apr 6th, 2016 at 7:10pm
Print Post  
Yeah, u8g is the library for driving the display in this project. There are a TON of files that get compiled from that lib. The program would probably be closer to 60k if it weren't for the fonts used from u8g. Unfortunately, I'm using a lot of different sensors and components for this project, so keeping the size small is next to impossible.

Having gcc run in a separate thread will undoubtedly alleviate the hang of VS. Looks to me like the individual compilation operations, of which there are A LOT, are what are causing VS to hang.

Question: Is there anything I can do to speed up gcc compiling? It seems to me like the amount of time each operation takes is longer than I would expect. Some super small files take a couple hundred ms, and because there are so many of them (119 from u8g alone), they add up to that ~32 seconds.
  
Back to top
 
IP Logged
 
bitNine
Junior Member
**
Offline


Posts: 13
Joined: Oct 2nd, 2015
Re: First compile hangs VS
Reply #5 - Apr 6th, 2016 at 7:12pm
Print Post  
Oh, and there is no difference between having deep search includes enabled vs. disabled, on the second compile. Each are around .75 - .85 second.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First compile hangs VS
Reply #6 - Apr 6th, 2016 at 7:27pm
Print Post  
You won't be able to speed up the compile that much. 

When is it an issue? Just changing between release/debug?
  
Back to top
IP Logged
 
bitNine
Junior Member
**
Offline


Posts: 13
Joined: Oct 2nd, 2015
Re: First compile hangs VS
Reply #7 - Apr 6th, 2016 at 9:13pm
Print Post  
Usually the only time it's an issue is when swapping between release and debug. But for awhile I had to stop using debug mode because literally every single time I would compile, even after just making a tiny change to the main program, it would recompile. That was several months ago, and also several versions ago. I was having to wait almost a full minute every time I made a change, because 30 seconds to compile and 30 seconds to upload. I switched to release and had to forego the conveniences of debug mode in favor of much faster compile.

Just got back to this project after a couple months of testing, and haven't had this issue, but figured it was worth asking about the compile time.
« Last Edit: Apr 6th, 2016 at 9:14pm by bitNine »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First compile hangs VS
Reply #8 - Apr 6th, 2016 at 9:19pm
Print Post  
There has been a lot of dev work in cache and compile during the past few months so maybe you had an earlier version that behaved differently.

Thanks for the update. Please let me know if you find a combination that causes recompile when switching between release and debug.
  
Back to top
IP Logged
 
bitNine
Junior Member
**
Offline


Posts: 13
Joined: Oct 2nd, 2015
Re: First compile hangs VS
Reply #9 - Apr 6th, 2016 at 10:31pm
Print Post  
It does a complete recompile every single time I switch between release and debug. Even if I switch back and forth without making any changes, it recompiles every time. Did you mean to say let you know if I find a situation where it's doing a complete recompile when NOT changing between release and debug?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First compile hangs VS
Reply #10 - Apr 6th, 2016 at 11:05pm
Print Post  
No that's what I wanted to know thanks. It needs more intelligence and doesn't need to drop the lib and core cache when switching between Release/debug. It just needs to drop the local project sources cache and any local project libraries.

I suspect this changed when the new gdb debug option was released for the Arduino Zero. That allows core and libs to be debugged more easily but involves compiling with different optimization settings to the default. It's also possible to set different "defines -D" for different configurations such as "release/debug/custom" in the visual micro project properties. Again this would require a full recompile.

So what we need is to detect those two exceptions and only in that case drop the core/lib cache.

I'll add it to the list thanks.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint