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) Very long compile times (Read 2609 times)
Aidan
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2015
Very long compile times
Mar 19th, 2020 at 8:08pm
Print Post  
I'm getting ridiculous compile times on todays build (several minutes). I had the same problem on the previous build from a couple of days ago, but I managed to get rid of the problem by removing VM and then cleaning the registry of any VM entries, then re-installing. A project clean and rebuild took a couple of minutes. Afterwards, a compile to upload time was around 10 seconds which I can live with.

I've now installed todays build and I'm back to the same long compile times, but I can't solve it.

The time is being taken in deep scanning for libraries. If I disable this, then it throws several library errors, missing .h files.

It's as if it's not using the library cache. I've also tried using a local project core instead of the shared core.

On top of all that, no matter what I do, it also appears to be rebuilding the libraries every time
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Aidan
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2015
Re: Very long compile times
Reply #1 - Mar 19th, 2020 at 8:13pm
Print Post  
...here's the project file for my question

Also, I'm running in Atmel Studio 7
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Very long compile times
Reply #2 - Mar 19th, 2020 at 8:32pm
Print Post  
So a few things here... We do need the output with both settings enabled as descrived above. The output is missing the build properties which help us.

How long does it take to build in the arduino ide? 1st and 2nd time (without clean)? The 2nd time is what we need to see the output for.

Slow compile is usually caused by the virus checker, most likely related to the toolchain .exe that has to be run for each file.

We would expect one full compile per project after a visual micro or board manager toolchain update. However. if using shared cache, the core should only compile one time for each "type/board options".

Please provide the build output after a second compilation where you have not altered board or cache settings.

Reinstalling Visual Micro will not affect the build. Build times are not affected by files/settings installed with Visual Micro.

I don't think it is related but a path with lots of spaces isn't always a good thing for arduino or for some compilers.

Code
Select All
%20Development/Projects 



How long does build take with the virus checker switched off temporarily?

Please also upgrade to Visual Micro 20.03.18.1 because there is a bug in the last major release where the auto update check for a new release was happening too often, instead of once per day. It is unrelated but worth a mention.

Thanks
« Last Edit: Mar 20th, 2020 at 2:25am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Aidan
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2015
Re: Very long compile times
Reply #3 - Mar 20th, 2020 at 8:32am
Print Post  
I've downloaded yesterdays build and that appears to have fixed it. That's great, thanks, it was becoming a right pain!
  
Back to top
 
IP Logged
 
Aidan
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2015
Re: Very long compile times
Reply #4 - Mar 20th, 2020 at 8:54am
Print Post  
Sorry, false alarm. I hadn't modified my code. So, the first time I compile after changing my code, it takes over 70 seconds to compile and link. The second time is just a few seconds as it says that it's used previously compiled libraries.

As soon as I make a mod to the code, I'm back to over a minute compile time as it does a deep library scan once again.

Having the virus scanner turned on (AVG) adds 1 second to the total time.

BTW, I put a Boards.txt in the project folder with "vm.ctags=false" in the project folder




  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Very long compile times
Reply #5 - Mar 20th, 2020 at 1:03pm
Print Post  
Your system appears to be working correctly but your pc is struggling for some reason. It is correct that if a file changes that contains #includes the #includes are re-parsed.

You did not respond to my question about compilation in the arduino ide. First build should be long, subsequent build faster? How long?
  
Back to top
WWW  
IP Logged
 
Aidan
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2015
Re: Very long compile times
Reply #6 - Mar 20th, 2020 at 2:12pm
Print Post  
Hi. Sorry, I tried compiling in the normal Arduino IDE, but it kicked out loads of missing library errors. I'm giving it another go now
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Very long compile times
Reply #7 - Mar 20th, 2020 at 3:33pm
Print Post  
You might need to ensure that your file>preferences>sketchbook folder is set to your one drive if you changed that in visual micro.

Also ensure the file>preferences>board urls match the ones in Visual Micro IDE Location > Board urls.

In essance the options you set in Visual Micro can be set in the Arduino IDE. Visual Micro will use same or allow you to override/append.
  
Back to top
WWW  
IP Logged
 
Aidan
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2015
Re: Very long compile times
Reply #8 - Mar 21st, 2020 at 6:50pm
Print Post  
OK, I've installed the latest Arduino IDE (v1.8.12) which then started kicking out errors about various libraries, so I've downloaded the latest versions which has fixed that. I've also resolved some dupliate libraries that were in the path for historical reasons.

So, Arduino IDE takes 46 seconds to compile at all times. In other words even if I don't modify the sketch, it still takes 46 secs.

Atmel Studio wih VM takes 70 secs at all times if I modify the sketch between compilations as it insists on deep scanning every library. If I don't modify anything, it takes around 10s for a re-compile.

Bear in mind that I had the same problem on the previous version last week, but I managed to sort it out by using the Force. Nothing I have doneĀ  stops VM from deep scanning, however it does appear to be using the pre-compiled libraries anyway despite the deep scan.

I've attached the latest verbose output from Arduino IDE and VM plus the project file again to see if you can make sense of it

Thanks for your help
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Very long compile times
Reply #9 - Mar 21st, 2020 at 7:56pm
Print Post  
Thanks for the files. It's not a release issue ...

The build in arduino ide and visual micro are identical except that visual micro also copies the build output up to the project release/debug folders because that option is enabled.

The arduino ide had previously compiled the core and it is also possible you have enabled high cache in the file>preferences at some previous time or had previously built for the esp32dev in the arduino ide. This simply means it already had  cached core.

Both IDE's are using the same Temp folder location and both are discovering the same libraries.

The arduino ide does same deep search as visual micro it is shown as "discovering libraries" in the arduino output. You can not switch off deep search in te arduio ide.

Deep search will always run through the file that has changed to detect #include for which it can select the correct library. If a library has previouly been compiled that has no bearing on deep search attempting to detect which libs the code is using.

Deep search honors conditional #if statements therefore any change of code can change of an #include is now valid or not. It is possible to have #includes that should be ignored because the #if condition fails therefore deep seach needs to re-run against the code. It is annoying that the GCC-E system we all use for deep search notifies only one #include at a time. Therefore we have to run once for each discovered #include.

Switching off deep search means tht we use a faster less capable system to discover #includes in .ino code. The faster system can not determine if an #include is conditional or not. The deep search also searches the source code of discovered libraries to see if a library is required that has not been #included by the user in the project code. Therefore you need to ensure all required libs have an #include in the .ino code so that the library can be discovered.

Your pc performance is at least 5 times slower than normal and possibly an issue with the virtual machine. If you look at the build output you will see that we just run .exe files to build each file and to link etc. You can grab any one of those .exe command lies and paste into cmd.exe or a .bat file. Then run, that is what is slow for you. 

For me the .ino code below compiles in 9.6 seconds 2nd time with deep search enabled (after adding a method and saving).

Sorry to say it is nothing to do with arduino or visual micro otherwise we could fix something. I am using the slightly newer (latest) esp32 core from board manager but I checked against the version you are using the tool chain .exe's look to be same.

Code
Select All
#include <SPIFFS.h>
#include <vfs_api.h>
#include <FSImpl.h>
#include <FS.h>
#include <ArduinoJson.hpp>
#include <ArduinoJson.h>
#include <SPI.h>
#include <Adafruit_SSD1306.h>
#include <gfxfont.h>
#include <Adafruit_SPITFT_Macros.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_GFX.h>
void setup() {

}

// the loop function runs over and over again until power down or reset
void loop() {

}
 

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint