Why is my Lightroom so slow?

I got an emergency phone call from Patrick, a photographer friend:


Marc — Help! My Lightroom's dead. Everything crawls, it's so slow, it's been an hour in it has only exported a dozen of photos. I need to be finished by tonight, I have to post the photos, tonight.
Me — Are you running anything else?
Marc — No, I made sure of that.
Me — Are you connected to the Internet?
Marc — No, nothing running.
Me — Kill your anti-virus and see what happens.

Half an hour later, I get another phone call from Patrick, his Lightroom is still slower than a slug. I tell him that I will be at his place shortly.

I started to look at his system. A fast quad core, Windows Vista Business with 4 Gig RAM. The Lightroom catalog is not that big, only 25,000 photos in the catalog. The antivirus, real-time, has been disabled. Nothing unusual running in the background. Plenty of diskspace free. All the usual suspects and nothing. Lightroom still runs like a slug.

Time to defrag the hard drive. Before defragmenting the hard drive, I need to clean all the Temp files.

Under Windows:

Accessories > System Tools > Disk Cleanup

And what do you know? The Trash contains over 100Gb of deleted files. 10 minutes later, all the temp files have been deleted. We tried Lightroom to see how slow it would be before defragmenting and how fast after defragmenting. Guess what? Lightroom was flying, kind of, almost. But Lightroom was so much faster after emptying the trash.

I launched the defrag and left. See: Lightroom -- Speedup Your Computer for defragmenting your hard drive.

For the Mac, you will have to run scripts to cleanup all of you temp files, including emptying the trash.