I have been digging and found out that when Arduino compiler is running there are dozens of "listComPorts" processes running simultaneously. That seems quite strange.
Please, see the attached image.
When the compiler is closed, the processes vanish one by one at a few seconds interval. Say, one minute after and they are all gone.
I isolated listComPorts.exe renaming it to _listComPort.exe. Things are much better in terms of CPU activity (less then half), but compilation time remains about the same.
The Intel Pentium 4 Dual Core T4400 was announced in 2009. It was billed as an entry level CPU for laptops. At its announcement it was a slower clock rate and had just 1MB L2 cache. It was intended for less demanding applications such as office, e-mail, and simple games such as solitaire.
This being said, your computer is no slouch, and Arduino compilation is not all that demanding. The real issue is that compilation is I/O bound and a lot of time is being spent waiting for the disk drive, which is likely a mechanical drive running at 4200 RPM rather than 5400 RPM. Low-cost laptop drives also suffer from slower seek time than desktop drives. As to RAM, 4GB is plenty, though 8GB might be marginally faster, as the extra RAM can be used by Windows to cache program DLL files used during Arduino compilation.
One solution to your issue is the advice to be patient. This costs you nothing but your time.
Another possibility (short of buying a more expensive computer) is to replace the laptop hard drive with a Solid State Drive. I expect your current computer takes about 45 seconds to start Windows, with a SSD it should be under 10 seconds. A 128MB drive is enough, 256MB would be better if you have a lot of video files. You could put your old drive in a USB enclosure if you really have a huge amount of data.
Check with the crucial.com web site for price and availability but with a file transfer cable/software the upgrade should run less than $100 US.
So, it looks like the scenario you refer is typical for my Win 7 configuration in that specific entry-level laptop.
Well, looks like I found out a solution in a opposite direction you suggest.
The same do nothing code compiled in a much older Centrino with a much older 80GB HDD rotating much slower, half the memory, much less cache RAM, running XP and much lower CPU clock compiles in less than 1/3 the time and does not load the CPU while the compiler is idle.
While me T4400 Win7 machine continues with the same laziness concerning time to compute a Arduino do nothing code, (read above) I installed the Arduino compiler in a XP virtual machine under the same Win7 ulimate OS.
It runs the same cod in about three seconds.
So, under Win7/T4400 it takes 30s, under much older XP/Centrino machine it takes 10s, in XP_virtuel_machine/Win7/T4400 it takes 3s.
I don't know if there s something wrong with Win7 itself but I would be surprised because software like PSPICE, Solidworks, etc, run nicely in it. Also, Access compressing and recompiling or converting MDB to MDE of 60MByte code runs nicely.
Anyway, for the moment, running Arduino in XP virtual machine seems to be a solution. No problem with the USB access under virtual machine. If someone needs some more details, please just ask.
Ok. Drastic measures. I reinstalled the 6 year old OS (windows 7 ultimate) and now the Arduino compiler runs in a couple seconds.
Didn't have any specific complaint except with Arduino compiler. I tried in another similar computer where it took 3 seconds, so I decided to reinstall the OS. I couldn't figure out what was specifically framing the compiler.
After some more tests I found out that anti-viruis Comodo significantly (10x) delays Arduino compiler performance. Even disabling ALL Comodo options it heavily delays the compiler.
That happens in Windows 7 NOT in XP. I will try and inform about what happens with some other anti-virus.