There are lots of reasons for slow windows compiles etc.
There are just as may answers to that question.
Most common fixes revolve around antivirus / anti malware products then moving onto custom file locations.
You may be best using the search option provided for you ate the top of the page and using "slow compile" as your search term.
Dont be put off by the fact that the results are provided by Google as they are all results from the forums around here.
Some simple steps below.
Add the Arduino directories to your antivirus / anti malware / other security exclusions.
So that would be at least two of the following.
C:\Program Files (x86)\Arduino
C:\Users\yourname\AppData\Local\Arduino15 depends on IDE
C:\Users\yourname\AppData\Roaming\Arduino15 depends on IDE
If you have your sketches set up in a different location it’s also worth adding that directo
Additionally if you also use the online IDE “CREATE” the following directories.
If you have installed to a different drive swap the drive letter as needed.
If you also have an unzipped IDE installed that path should also be added to exclusions