The Instruction That Changes (almost) Everything: TRIM

TRIM is an interesting command. It lets the SSD prioritize blocks for cleaning. In the example I used before, a block is cleaned only when the drive runs out of places to write things and has to dip into its spare area. With TRIM, if you delete a file, the OS sends a TRIM command to the drive along with the associated LBAs that are no longer needed. The TRIM command tells the drive that it can schedule those blocks for cleaning and add them to the pool of replacement blocks.

A used SSD will only have its spare area to use as a scratch pad for moving data around; on most consumer drives that’s around 7%. Take a look at this graph from a study IBM did on SSD performance:


Write Amplification vs. Spare Area, courtesy of IBM Zurich Research Laboratory

Note how dramatically write amplification goes down when you increase the percentage of spare area the drive has. In order to get down to a write amplification factor of 1 our spare area needs to be somewhere in the 10 - 30% range, depending on how much of the data on our drive is static.

Remember our pool of replacement blocks? This graph actually assumes that we have multiple pools of replacement blocks. One for frequently changing data (e.g. file tables, pagefile, other random writes) and one for static data (e.g. installed applications, data). If the SSD controller only implements a single pool of replacement blocks, the spare area requirements are much higher:


Write Amplification vs. Spare Area, courtesy of IBM Zurich Research Laboratory

We’re looking at a minimum of 30% spare area for this simpler algorithm. Some models don’t even drop down to 1.0x write amplification.

But remember, today’s consumer drives only ship with roughly 6 - 7% spare area on them. That’s under the 10% minimum even from our more sophisticated controller example. By comparison, the enterprise SSDs like Intel’s X25-E ship with more spare area - in this case 20%.

What TRIM does is help give well architected controllers like that in the X25-M more spare area. Space you’re not using on the drive, space that has been TRIMed, can now be used in the pool of replacement blocks. And as IBM’s study shows, that can go a long way to improving performance depending on your workload.

Why Does My 80GB Drive Appear as 74.5GB? Understanding Spare Area Tying it All Together: SSD Performance Degradation
Comments Locked

295 Comments

View All Comments

  • valnar - Wednesday, September 2, 2009 - link

    Anyone?
  • antinah - Tuesday, September 1, 2009 - link

    For another great article on the SSD technology.

    I'm considering an Intel G2 for my brand new macbook pro, and if I understand what I've read correctly, performance should not degrade too much although OSX doesn't support trim yet.

    I also doubt Apple will wait too long before they release an update with trim support for osx.

    I just recently switched to mac after a lifetime with pc/windows. Anything i shoud be aware of when I install the SSD in a mac compared to pc running windows? (other than voiding the warranty and such). I'm thinking precations regarding swap usage or such.

    Best regards from norway
    Stein
  • medi01 - Tuesday, September 1, 2009 - link

    So I absolutelly need to pay 15 times as much per gigabyte as normal HDDs, so that when I start Photoshop, Firefox and WoW, straight after windows boots, it loads whopping 24 seconds faster?

    That's what one calls "absolutelly need" indeed and you also chose amazingly common combination of apps.
  • Anand Lal Shimpi - Tuesday, September 1, 2009 - link

    You can look back at the other two major SSD pieces (X25-M Review and The SSD Anthology) for other examples of application launch performance improvements. The point is that all applications launch as fast as possible, regardless of the state of your machine. Whether you're just firing it up from start (which is a valid use scenario as many users do shut off their PCs entirely) or launching an application after your PC has been on for a while, the apps take the same amount of time to start. The same can't be said for a conventional hard drive.

    Take care,
    Anand
  • Seramics - Tuesday, September 1, 2009 - link

    its not abt the 24seconds but rather the wholly different experience of near instantaneous u get wit ssd tht cannot be replicated by hdds
  • medi01 - Tuesday, September 1, 2009 - link

    Nobody starts mentioned apps together directly after boot.

    I've played WoW for a couple of years, and never had to wait dozen of seconds for it to start.

    Most well written applications start almost instantly.

    And the whole "after fresh boot" is not quite a valid option neither, I don't recall when I last switched off my pc, "hibernate" works just fine.

    The "you get completely different experience" MIGHT be a valid point, but it was destroyed by ridiculous choice of apps to start. And I suspect that it is because NOT starting stuff all together and right after boot, didn't show gap as big.
  • kunedog - Tuesday, September 1, 2009 - link

    Anand, I think your article titled "Intel Forces OCZ's Hand: Indilinx Drives To Drop in Price" (http://www.anandtech.com/storage/showdoc.aspx?i=36...">http://www.anandtech.com/storage/showdoc.aspx?i=36... could also use a follow-up, primarily to explain why the opposite has happened (especially with the Intel drives). Is this *all* attributable to Intel's disaster of a product launch? Maybe not, but in any case it deserves more attention than a brief mention at the end of this article.
  • zero2espect - Tuesday, September 1, 2009 - link

    great work again. it's for this reason that i've been coming here for ages. great analysis, great writing and an understanding about what we're all looking for.

    one thing that you may have overlooked is the difference in user experience due to the lack of hdd "buzz". fortunate enough to find myself in posession of a couple of g2160gb jobbies, one is in my gaming rig and the other in the work notebook. using the notebook the single biggest difference is speed (it makes a 18mo old notebook seems like it performs as fast as a current generation desktop) but the next biggest and very noticible difference is the lack of "hum", "buz", "thrash" and "vibrate" as the drive goes about it's business.

    thanks anadtech and thanks intel ;-P
  • Mr Perfect - Tuesday, September 1, 2009 - link

    Anand,

    Would you happen to know if there are different revisions of the G2 drives out? Newegg is listing a 80GB Intel drive with model #SSDSA2MH080G2C1 for $499, and another 80GB Intel with model #SSDSA2MH080G2R5 for $599. They are both marked as 2.5" MLC Retail drives, and as far as I can tell they're both G2. What has a R5 got that a C1 doesn't? The updated firmware maybe?

    Thanks!

    PS, dear Newegg, WTF? 100% plus price premiums? I'm thinking I'll just wait until stock returns and buy from another site just to spite you now....
  • gfody - Tuesday, September 1, 2009 - link

    It looks like the R5 is just a different retail package - shiny box, nuts and a bracket instead of just the brown box.
    Why Newegg is charging an extra $100 for it.. just look at what they're doing with the other prices. I am losing so much respect for Newegg right now. disgusting!

Log in

Don't have an account? Sign up now