Arduino IDE takes long to compile on Windows 10

Hi! My IDE takes about 2.5 minutes to compile the blink sketch and takes 20 seconds to compile the second time when I use Windows 10. When I restart the IDE, it takes 2.5 minutes to compile the first time again. This is not the case when I use Windows 7 or Linux where it takes less than 5 seconds to compile. What could be the possible cause? I tried all IDE versions but none seem to be faster than the other. I have been looking for a solution but I couldn't find one. This is the Verbose Output for reference:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\jasper\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\jasper\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\jasper\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10802 -build-path C:\Users\jasper\AppData\Local\Temp\arduino_build_835710 -warnings=none -build-cache C:\Users\jasper\AppData\Local\Temp\arduino_cache_547990 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\jasper\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\jasper\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\jasper\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\jasper\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10802 -build-path C:\Users\jasper\AppData\Local\Temp\arduino_build_835710 -warnings=none -build-cache C:\Users\jasper\AppData\Local\Temp\arduino_cache_547990 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\jasper\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\sketch\Blink.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\sketch\Blink.ino.cpp" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\sketch\Blink.ino.cpp" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\sketch\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -x assembler-with-cpp -flto -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_pulse.S" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\wiring_pulse.S.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\WInterrupts.c" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\WInterrupts.c.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\hooks.c" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\hooks.c.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring.c" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\wiring.c.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_analog.c" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\wiring_analog.c.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_digital.c" -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\wiring_digital.c.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\wiring_pulse.c" -o

The verbose output is 72 lines long and it ends with

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc-ar" rcs  "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\core.a" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\abi.cpp.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc-ar" rcs  "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\core.a" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\main.cpp.o"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc-ar" rcs  "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\core.a" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\core\new.cpp.o"
Archiving built core (caching) in: C:\Users\jasper\AppData\Local\Temp\arduino_cache_547990\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710/Blink.ino.elf" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710\sketch\Blink.ino.cpp.o" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710/core\core.a" "-LC:\Users\jasper\AppData\Local\Temp\arduino_build_835710" -lm
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710/Blink.ino.elf" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710/Blink.ino.eep"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710/Blink.ino.elf" "C:\Users\jasper\AppData\Local\Temp\arduino_build_835710/Blink.ino.hex"
Sketch uses 928 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

Usually this is caused by your antivirus. The Arduino IDE has to run a bunch of different programs and create a bunch of temporary files during the compilation so if the antivirus is set to scan each one it really slows things down. You could test to see if this is the cause by TEMPORARILY disabling your antivirus for a single compile and then starting it again after. If that solves the slow compilation problem then you can set the antivirus to ignore the various folders that the Arduino IDE uses.

I forgot to say that I have the antivirus disabled though nothing really changes when I disable it.

Somebody else had a very similar issue recently so I am going to point you at that thread to see if there is anything in it that might help.

Head up it can be a long process

The full step through is HERE