Can You Spare Some Performance?
TH: OK, for people who might have missed it up until now, what is TRIM?
LT: OK. A characteristic specific to NAND is that you cannot write over a NAND cell that has previously stored data. For example, on your notebook hard drive, let's say you deleted your 2GB iTunes folder. All you’re doing when you delete is just deleting the pointer to that file, right? The data is still physically there on the drive, which is why you can do recovery and things like that later on. But let's say you've got a new batch of data that you're copying. The hard drive is going to look for a space, see that 2GB of free space, and just copy right over the top of it. On an SSD, that same thing couldn't happen—not quite that way. When you delete that same 2GB iTunes folder from your SSD, you’re still deleting the pointer, but when you try to write back over that area, the SSD won't do it. The NAND cells have to be empty before it will do that. As you probably know, this process is called garbage collection. Now, with TRIM, if you were to delete that same 2GB iTunes folder, Windows 7 would basically tell the drive that there's just been a deletion, so go ahead and clean that 2GB area up. Do it ASAP. Don't wait until I need to make a write. That way, the drive will never have to stumble over invalid data. Is that about right, Tony?
TC: Yes. And actually, TRIM was an improvement even before Windows 7. When you want to write data to a single page, you need to erase the whole block and move the data in that block page to another area. That's why SSD has this built-in write latency that inhibits greater performance. Many previous generations of SSDs, when they first come out, would hang for several seconds when you’d write to them. So even before TRIM was available, a lot of SSD controllers had to implement garbage collection in the firmware. Garbage collection means that when older data is deleted, it creates an indirect table to notify the controller and say, “OK, when you have free time, you can start to move those various data out, erase the block, and make it free for the next time the system wants to write to it.” The TRIM command really just helps the SSD do better garbage collection. It essentially provides that fresh, new drive performance without any degradation.
TH: What is the role of spare drive space in all this?
LK: Pre-TRIM, spare space was something people desired. Just five or six months ago, at the Intel Developer Forum, Intel was advocating leaving 10% to 20% spare NAND when you configured the drive. So if you purchase a 64GB SSD, it formats to 59.9GB. If you were to follow the Intel advice, you’d actually partition to like 52 for all that spare NAND. Then they said, once TRIM came out and became supportable on Windows 7, it wasn’t as big of a factor.
TH: A lot of drives now in use predate TRIM, and common wisdom always said that the more spare space you can leave, the better the drive will perform. So 20% is better than 10%, etc. But if all I’m doing is small writes, that shouldn’t involve a lot of data shuffling. Why do we need so much room?
TC: When you boot up, you load applications. When you surf the Internet, you store temporary files. When you use a real burst of memory, you need page caching from the hard drive. So hard drive space is really critical to the OS. It's my understanding that with Windows 7 right now, you need a minimum of 16GB just to install the OS. When you have a 40GB drive, you can figure out how much free space you’ll need. You also know how much memory you have in your system. You take those factors, put them together, and figure out how much free space the system needs for the best performance. This is a basic formula for any OS to run smoothly. Besides that, SSD wear leveling requires a certain amount of free space for use. I like that Intel came out with the tools for this even before the TRIM command. They have an optimized program that helps the data to move in the drive, and with the TRIM command, they can help the system without using additional utilities.