4 ms·
There is a background cleanup process for SSDs called trim, but it does something different. I mean magnetic hard drives are very similar to vinyl recordings,
by ReaLNero 5y ago
There is a background cleanup process for SSDs called trim, but it does something different.
I mean magnetic hard drives are very similar to vinyl recordings, so it's clear why contiguous file placement has lower latency, and thus why defragmentation is a big performance boost. I believe since SSDs are organized differently (many NAND chips), their access latency doesn't benefit as much from a contiguous file placement.
Furthermore, defrag necessarily has to write. Since SSD cells have a finite number of writes before they do not retain data, defragmentation shortens your SSD's lifecycle.
- pkaye 5y agoSSDs have their own logical to physical mapping tables. When you trim, it is telling the SSD you no longer care about that entry in the table so the physical space can be freed up. In terms of latency there is no seek time difference from one location to another hence defrag has no benefit. In fact defrag will just cause more wear.
- jeffbee 5y agoFragmentation is even beneficial in SSDs. When the contents of a logical file are physically scattered, the internal parallelism of many flash devices can be exploited. If your file are physically compact, you'd lose that parallelism.
- pkaye 5y agoI used to work on SSD FTL so have some ideas on the internals. Generally the writes are stripped across the flash devices. Main thing is you need command queueing to exploit the parallelism. You can do a few tricks like stride detection to prefetch in some cases because it makes the benchmarks look good.