When a project sometimes compiles fast and sometimes very slow, it most likely is not the compiler or the linker or any other tool used while building. There is a small change it is, but most likely it is a slowdown caused by other software. An indexer running in the background might slow it down, a virus killer, other tools accessing the files the compiler and linker need, ...

The biggest bottleneck in most home computers is I/O, and more specific the hard disk.When an indexer or virus killer is scanning the system, it looks for new files. It also might have some other restrictions to scan certain files, like timers etc... When scanning a file, a program might create a lock on those files, preventing the compiler or linker to proceed until the lock has been removed.

One suggestion is to build all the software in a specific folder. Then, in the index, virus killer, etc... set up this folder so it doesn't get scanned (if possible of course).