I had been making tiny changes to a sketch that writes to a display screen for about 6-7 hours today, then randomly when I hit upload, the process took a very long time.
I waited and waited, then eventually pulled the USB plug and restarted IDE (1.6.3).
Restarted Windows, same problem.
The little light flashes on the Arduino during the process, then stops for a minute, then starts flashing again, the process can continue for 5-10 minutes before I stop it.
I tried with a blank sketch, this worked fine - upload completed straight away.
I tried the same with a basic example sketch - upload completed straight away.
I tried with a bigger sketch (different to my sketch above) and it took ages again!
Then I tried all of the above with another Mega 2560 I had hanging around (which I've never had problems with) - the same problem!
I removed the driver in Windows and deleted the driver files and re-installed - same problem!
I changed the COM port from 3 to 4 in the Windows device driver - properties for the USB Serial Device. Fixed! It then uploaded an old sketch I'd written that was large - did it in the usual relatively quick time (10 seconds).
THEN... I uploaded the original sketch that I was working on when the problem started - and argh! The "uploading..." is displayed for a very long time again!