The tidy-up your computer quietly stopped doing
For two decades, defragmenting the drive was the first thing anyone did to a slow computer, and it worked. Then the drives changed underneath the advice. Your laptop's own maintenance tool now does something else entirely, and the reason why is a lesson in what "slow" actually costs.
If you used a Windows PC in the late 1990s or 2000s, you remember the screen. A grid of little coloured blocks, scattered and jumbled, slowly being shuffled into neat, solid runs as the defragmenter worked through the night. In the morning the computer felt quicker. Programs opened faster. It was one of the few pieces of computer maintenance that ordinary people could see working.
So the habit stuck. Computer slow? Defragment the drive. Plenty of people still do it, or install a third-party tool that promises to do it better, or feel a flicker of worry when the system lists their drive as needing optimization.
On most computers sold in the last several years, that habit does nothing useful, and a little harm. To see why, you need to know what fragmentation actually cost, because the cost was never the fragmentation itself.
The intuition, stated fairly
Here is the belief at its best:
Over time, files get chopped into pieces and scattered across the drive. Reading a scattered file means hunting for all its pieces, which takes longer than reading one tidy block. Defragmenting gathers the pieces back together, so the computer reads faster. Tidy is fast; messy is slow.
Every part of that was true for the drives most people owned for decades. Fragmentation is the real name for a file stored in several separate pieces rather than one continuous run. It happens naturally: files grow, get deleted, and leave gaps that new files are fitted into. And the "tidy is fast" rule matched experience. People defragmented, and the machine felt better.
The crack
Open the built-in "Optimize Drives" tool on a modern Windows laptop with a solid-state drive and press the button. It runs, finishes quickly, and reports the drive as optimized. But it has not defragmented anything.
Microsoft's own documentation for the command behind that button, Optimize-Volume, spells out the default behaviour by drive type. On a traditional hard disk, it analyses and defragments. On a solid-state drive that supports a feature called TRIM, it does something different: it runs a "retrim," which tells the drive which parts of its storage no longer hold any useful data.
If gathering the pieces of files together were how you speed up a drive, the operating system's own maintenance tool would be doing it on every drive. It deliberately does not. Something about the solid-state drive changes the rule.
What a piece really costs
The cost of fragmentation was never the number of pieces. It was what the drive had to physically do to get from one piece to the next.
A traditional hard disk drive stores data on spinning platters, read by a tiny head on the end of a moving arm, much like a record player. To read a piece of a file, the drive has to swing the arm to the right track, which is called a seek, and then wait for the platter to rotate until the right spot passes under the head, which is called rotational latency. Both are mechanical, and mechanical means slow by computer standards.
The striking thing is where the time goes. In the fragmented case, two thirds of the 150 milliseconds is spent with the arm moving and the platter turning, reading nothing at all. Multiply that across the thousands of files a computer touches while starting up or opening a large program, and the old advice makes complete sense. Gathering pieces together eliminated mechanical waiting.
A solid-state drive has no platters and no arm. It stores data as electrical charge in flash memory chips, and it reaches any location electronically. There is still a small cost for each separate request, on the order of a tenth of a millisecond, roughly a hundred times less than the hard drive's 12.5. Run the same file through it:
On the hard drive, scattering the file into eight pieces added 87.5 milliseconds, more than the whole read took when it was in one piece. On the SSD, the same scattering added seven tenths of a millisecond, far below anything a person could notice. The fragmentation is identical. What changed is the price of each jump.
There is a deeper reason the tidy-up is pointless on flash. An SSD has its own small computer inside, a controller running what is called a flash translation layer. It keeps a private map from the addresses your operating system uses to the actual physical locations on its chips, and it deliberately spreads data across many chips so it can work on them in parallel. A file that looks perfectly contiguous to Windows is already scattered in the silicon, on purpose. Defragmenting rearranges the operating system's view of the file, not where the data really lives.
And it is not free. Flash memory wears: each cell can be erased and rewritten only a limited number of times before it becomes unreliable. Manufacturers express this as an endurance rating in terabytes written. Samsung, for example, rates its 870 EVO 1 TB drive for 600 terabytes written within its five-year warranty. A full defragmentation can rewrite much of the data on the drive. One run will not kill a modern SSD, but it spends a slice of the drive's write budget for no speed gain.
That explains what the Optimize Drives button does instead. TRIM is a way for the operating system to tell the SSD which blocks no longer hold anything you need, for example after you delete a file. Without that hint, the drive cannot know the data is dead, and it may keep carefully copying it around during its internal housekeeping. With it, the drive can clear those blocks ahead of time, which keeps writes fast. Retrim simply re-sends those hints in bulk, in case some were missed. It is the maintenance that suits the hardware.
Where the old advice is still right
Here is the twist. The folk advice was not a myth. It was correct for the hardware it was invented on, and that hardware has not gone away.
Spinning hard drives are still everywhere: in older desktops and laptops, in external backup drives, in home network storage boxes, in large cheap storage arrays. On every one of them, the arithmetic in the first box still holds. A heavily fragmented hard drive really is slower, and defragmenting it really does help. That is why Microsoft's tool still defragments hard disks by default. If your machine has a spinning disk, the old ritual is still good maintenance.
There is a second, smaller twist, and it comes from inside Microsoft. In December 2014, the developer Scott Hanselman published a post titled "The real and complete story - Does Windows defragment your SSD?", written with developers from the Windows storage team. Their answer: yes, sometimes. Windows will defragment an SSD about once a month if volume snapshots, the feature System Restore uses to keep older copies of files, are turned on. The reasons they gave are that snapshot copying performs badly on heavily fragmented volumes, and that a file system can only track so many fragments of a file in its own records, so extreme fragmentation can eventually cause errors or slowdowns that have nothing to do with seek time.
The regime, named
"Defragmenting speeds up your computer" is right for spinning hard drives, where every extra piece of a file costs milliseconds of mechanical waiting. It is wrong for solid-state drives, where a piece costs about a tenth of a millisecond and the rewriting wears the flash. Fragmentation still exists on SSDs and can matter at the extremes, which is why Windows occasionally handles it itself. It just stopped being what makes a computer feel slow.
What to actually do
- Find out what kind of drive you have. On Windows, open "Defragment and Optimize Drives": the Media type column says "Solid state drive" or "Hard disk drive." On a Mac or most recent laptops, it is almost certainly solid-state.
- On an SSD, leave the built-in optimization alone and on. It runs TRIM, and occasionally a light defragmentation when snapshots need it. Do not add a third-party defragmenter on top.
- On a hard drive, let the built-in schedule run. If you have a heavily used external hard drive or an old desktop with a spinning disk, a manual defragmentation is reasonable maintenance, ideally after a fresh backup.
- If an SSD computer feels slow, look elsewhere. A nearly full drive, too many programs launching at startup, too little memory, or a pending update are far more likely culprits than fragmentation.
- Keep some free space on an SSD. The drive's internal housekeeping works better with room to move data around. A drive filled to the brim slows down for reasons unrelated to fragmentation.
The general lesson: advice is a compressed form of a cost model. "Defragment your drive" really meant "avoid mechanical waiting." When the machine underneath stops having that cost, the advice stops applying, even though the words still sound right. When a rule of thumb stops working, look for the cost it was built to avoid.
How we know this
- Microsoft Learn,
Optimize-Volumedocumentation: with no parameters, hard disk drives get analysis and defragmentation, while solid-state drives that support TRIM get the ReTrim operation, described as sending TRIM and unmap hints for currently unused sectors. - Scott Hanselman, "The real and complete story - Does Windows defragment your SSD?" (3 December 2014), read in session, relaying developers from the Windows storage team: Storage Optimizer will defragment an SSD about once a month if volume snapshots are enabled, because of slow snapshot copy-on-write on fragmented volumes and file-system limits on the number of fragments; and Retrim exists because TRIM requests can be dropped.
- Samsung's published warranty rating for the 870 EVO 1 TB: 600 terabytes written or five years, whichever comes first.
- Textbook storage engineering: seek time and rotational latency in hard disks, the flash translation layer in SSDs, limited program and erase endurance of flash cells, and the purpose of TRIM. No individual study is cited for these.
The seek time, the 160 MB/s and 500 MB/s transfer rates and the tenth-of-a-millisecond SSD access cost are approximate typical figures, not measurements of a specific drive. The 8 MB file and its split into eight pieces are illustrative. Real drives, interfaces and file systems vary, and this guide does not claim any particular operating system's maintenance schedule beyond what the sources above describe.