user6834: Compilation of even the simplest program (like Blink) is extremely slow, the progress bar often hangs halfway for nearly half a minute.

Is this normal? I understand that not all computers are equally fast, but there's a huge difference between 3 seconds and 30 seconds  
edit
It appears from the report that every time I switch programs they're built anew completely:

Build options changed, rebuilding all

even when nothing has been changed. How can I avoid a complete rebuild?

user16944: This thread, Arduino IDE and ESET: Slow compilation, may be helpful if you use ESET (at least one user has reported that it helped), but it didn't help me since I'm using Comodo (and may be there are some other reasons).
Here's another thread, SLOW ARDUINO IDE regarding a solution which helped many users, since 2009 (the latest comment on the forum is dated year 2014).
Several useful posts here as well, Unbelievable slow compilation of simple sketches. Ok, I haven't tested all the solutions myself, but let me collect useful links here so that other guys can find them and I'll check them out, too. 

user4143: If you find compilation slow then yes, it is probably recompiling things that it doesn't really need to recompile.  This has always been a major failing of the Arduino environment, and is one of the major impetuses for the complete re-write of the whole compilation system in my IDE UECIDE.
That includes very aggressive caching of compiled library and core files as proper ".a" files which are stored away separate from your board selection and kept until something really does need compiling.  That way the first time you compile something for a board it may take 30 seconds, 50 seconds, whatever.  All subsequent compilations for that same board, even for different sketches (not including the compilation time of "fresh" libraries) would be around 2 seconds, even less.
That caching is especially important when you're running on a very slow system, such as a Raspberry Pi, when compiling can take many minutes without the caches in place, but only a few seconds on all subsequent compilations.

user31011: I had the same problem until today. Like many answers around the web, the problem seems to come from the anti-virus. My setup is Windows 10 x64 with a SSD and I use Windows Defender as the AV.
I tried by excluding the main arduino folder in "c:\program files (x86)\arduino", but it didn't improve the compilation time.
I checked the "verbose" option in the Arduino IDE and I've seen that it was calling the compiler from the AppData folder. So I add this folder to my AV exclusion list and it worked!
The compilation time improve by ten folds.
TLDR; In Windows 10, add the folder in %USERPROFILE%\AppData\Local\Arduino15 to the AV exclusion list.

user10007: I have found that this is a common issue across my development machines, however using Visual Micro for Visual Studio reduces this time by a significant factor.
I primarily use it for other Visual Studio features like Intellisense, refactoring, and solution management. Visual Micro has some compelling features of its own, like debugging tools, however I haven't used them.

Visual Micro 
Visual Studio Community Edition

I haven't personally tried, but I would expect that you can avoid the rebuild using the project/solution options in Visual Studio - I found that the compile time is fast enough in most cases with this environment for it to not matter.

6834: <p>Compilation of even the simplest program (like Blink) is extremely slow, the progress bar often hangs halfway for nearly half a minute.</p>

<p><img src="https://i.stack.imgur.com/wbMQM.png" alt="enter image description here"></p>

<p>Is this normal? I understand that not all computers are equally fast, but there's a huge difference between 3 seconds and 30 seconds  </p>

<p><strong>edit</strong><br>
It appears from the report that every time I switch programs they're built anew completely:</p>

<blockquote>
  <p>Build options changed, rebuilding all</p>
</blockquote>

<p>even when nothing has been changed. How can I avoid a complete rebuild?</p>
 16944: <p>This thread, <a href="http://forum.arduino.cc/index.php?topic=215107.0" rel="nofollow">Arduino IDE and ESET: Slow compilation</a>, may be helpful if you use ESET (at least one user has reported that it helped), but it didn't help me since I'm using Comodo (and may be there are some other reasons).</p>

<p>Here's another thread, <a href="http://www.johngineer.com/blog/?p=97" rel="nofollow">SLOW ARDUINO IDE</a> regarding a solution which helped many users, since 2009 (the latest comment on the forum is dated year 2014).</p>

<p>Several useful posts here as well, <a href="http://forum.arduino.cc/index.php?topic=82527.15" rel="nofollow">Unbelievable slow compilation of simple sketches</a>. Ok, I haven't tested all the solutions myself, but let me collect useful links here so that other guys can find them and I'll check them out, too. </p>
 4143: <p>If you find compilation slow then yes, it is probably recompiling things that it doesn't really need to recompile.  This has always been a major failing of the Arduino environment, and is one of the major impetuses for the complete re-write of the whole compilation system in my IDE <a href="http://uecide.org" rel="nofollow">UECIDE</a>.</p>

<p>That includes very aggressive caching of compiled library and core files as proper ".a" files which are stored away separate from your board selection and kept until something really does need compiling.  That way the first time you compile something for a board it may take 30 seconds, 50 seconds, whatever.  All subsequent compilations for that same board, even for different sketches (not including the compilation time of "fresh" libraries) would be around 2 seconds, even less.</p>

<p>That caching is especially important when you're running on a very slow system, such as a Raspberry Pi, when compiling can take many minutes without the caches in place, but only a few seconds on all subsequent compilations.</p>
 31011: <p>I had the same problem until today. Like many answers around the web, the problem seems to come from the anti-virus. My setup is Windows 10 x64 with a SSD and I use Windows Defender as the AV.</p>

<p>I tried by excluding the main arduino folder in "c:\program files (x86)\arduino", but it didn't improve the compilation time.</p>

<p>I checked the "verbose" option in the Arduino IDE and I've seen that it was calling the compiler from the AppData folder. So I add this folder to my AV exclusion list and it worked!</p>

<p>The compilation time improve by ten folds.</p>

<p><strong>TLDR;</strong> In Windows 10, add the folder in %USERPROFILE%\AppData\Local\Arduino15 to the AV exclusion list.</p>
 10007: <p>I have found that this is a common issue across my development machines, however using Visual Micro for Visual Studio reduces this time by a significant factor.</p>

<p>I primarily use it for other Visual Studio features like Intellisense, refactoring, and solution management. Visual Micro has some compelling features of its own, like debugging tools, however I haven't used them.</p>

<ul>
<li><a href="http://www.visualmicro.com/" rel="noreferrer">Visual Micro</a> </li>
<li><a href="https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx" rel="noreferrer">Visual Studio Community Edition</a></li>
</ul>

<p>I haven't personally tried, but I would expect that you can avoid the rebuild using the project/solution options in Visual Studio - I found that the compile time is fast enough in most cases with this environment for it to not matter.</p>
