Sign in with
Sign up | Sign in
Aftermarket SSD On A MacBook Pro: TRIM Gets Tested
By , Achim Roos,
1. TRIM On A Mac: Only For Apple's OEM SSDs

You already know that solid-state drives write data to 4 KB pages. In the process of relocating data, deleting stale data, and creating space for new data, they operate on larger blocks. This is what we refer to as garbage collection, and it's something that every SSD uses.

The trouble is that SSDs and operating systems typically don't have a very communicative relationship. When you delete a file, the OS marks the space consumed by that data as free, but doesn't tell the drive anything. Over time, you end up accumulating a lot of available space (according to the operating system) the SSD believes is still needed. It's only when an OS tells the drive to write to an address containing data that it figures out, "Ah, that information must be invalid." Up until then, those pages are still shuffled around by garbage collection, unnecessarily slowing down the SSD controller and wearing the drive's NAND cells prematurely.

This is where the TRIM command comes into play. When a file is deleted, the operating system sends a TRIM command to the SSD, marking those sectors as invalid data. At that point, the drive knows not to perform garbage collection on them.

Of course, support for TRIM comes from a few different places. The drive, controller, and operating system all need to be compatible. Fortunately, the process of building a TRIM-friendly ecosystem started a long time ago. Windows 7, Windows 8, Server 2008, Linux, OpenSolaris, FreeBSD, and OS X are all capable of the command. 

But just because a combination of hardware and software support TRIM doesn't mean it's always active. In the Windows world, we're fortunate enough that openness and compatibility are usually embraced. But Apple isn't so benevolent. It only allows TRIM to work on its OEM SSDs, and third-party drives installed aftermarket have this feature disabled.

The ways around this artificial limitation aren't secret. In fact, we showed you how to install a third-party SSD into a MacBook Air, turn TRIM on, and benchmark the drive in Upgrade And Benchmark Your 2012 MacBook Air's SSD. Today, we're showing you how to do the same thing using a different SSD and a different method, and then running another handful of tests.

2. Benchmark SSD: Samsung 840 Pro

Now, in Upgrade And Benchmark Your 2012 MacBook Air's SSD, we used OWC's Aura Pro 6G + Envoy, which employs a proprietary form factor and second-gen SandForce controller. According to OWC, TRIM isn't necessary in that configuration because SandForce's (now LSI's) DuraWrite technology frees up more space for garbage collection to do its thing.

In truth, though, DuraWrite and TRIM are complementary. User data pending deletion is still freed up TRIM. So, although DuraWrite does successfully aid in improving performance and minimizing write amplification, TRIM further improves this. That's why we used the terminal window to manually switch it back on.

A MacBook Pro gives you a more flexibility, since it'll accept a 2.5" SSD. That opens the door up to drives from any number of vendors based on different controller technologies and firmware versions. Samsung's 840 Pro is a good example. It's one of the fastest drives we've tested, and as a result we're using them in all of our test beds. But the 840 Pro doesn't have DuraWrite technology; Samsung doesn't benefit from compressible data, and its controller employs its own garbage collection algorithms. All the more reason to get TRIM up and running, right?

Although the company recently announced its new 840 EVO, which should replace the vanilla 840 soon, the 840 Pro remains its top-end model. As a reminder, the drive center on the company's own S4LN021X01-8030 NZWD1 controller and employs a 6 Gb/s SATA interface. The 840 and 840 EVO both utilize triple-level-cell NAND, which has implications on endurance and performance. But the Pro family leans on familiar MLC flash manufactured at 21 nm.

Samsung 840 Pro Technical Specifications

ManufacturerSamsung
Model840 Pro
Model NumberMZ-7PD256
Form Factor2.5" (7 mm)
Capacity256 GB
Price$240
ControllerMDX
Type of Flash21 nm MLC Toggle-mode NAND
Sequential Read/Write Performance
540 / 520 MB/s
Random Read/Write (4 KB, QD=32) Performance
100,000 / 90,000
Over-provisioning7%
Cache512 MB
InterfaceSATA 6Gb/s
AccessoriesSamsung Magician Software
WarrantyFive Years

3. TRIM Enabler, The Benchmark System, And Software

Again, Apple supports TRIM through OS X, but only when you use one of its OEM drives. Swap out for something else and TRIM gets disabled. We've heard the horror stories about turning it back on through third-party utilities, which is why in our previous piece we did this the hard way:

"Fortunately, the restriction isn't hardwired. There's a bit of terminal window work to lift the Apple SSD requirement, but it's all covered in sufficient depth at Github."

This time, for brevity's sake, we went ahead and gave the TRIM Enabler app a try. It's about as easy to use as you might imagine. Slide a lever from left to right and you're good. Just be aware that operating system updates tend to reverse this process, so you'll need to repeat it if OS X gets patched.

Before TRIM Enabler can be used, the option to allow software installations from anywhere (and not just from the App Store and identified developers) needs to be set in the operating system's settings.

Benchmark System and Software

We're using a MacBook Pro for our benchmark system. To be more specific, it’s the smallest version of the eleventh generation that was introduced in mid-2012, also known as the MacBookPro9,2 model.

The notebook originally came with a 500 GB hard drive, which we took out and dropped into an external USB 3.0 enclosure. Samsung's 840 Pro SSD takes its place. We booted the system from the original hard drive.

Apple MacBook Pro
ModelMacBook Pro
Model Number
MacBookPro9,2
CPUIntel Core i5-3210M
CPU Clock Frequency
2.5 GHz
Number of Cores
2
L2 Cache (per Core)256 KB
Shared L3 Cache3 MB
RAM4 GB
System Hard Drive
Seagate ST500LM012 (500 GB; 5400 RPM)

Benchmark Software

We’re sending the Samsung 840 Pro SSD though two rounds of benchmarks. First, we perform a secure erase, which tells the controller to clear all blocks on the drive. This resets the SSD to the state it shipped in, yielding the best possible performance. We then complete the first round of benchmarks, which consists of running AJA System Test and DiskTester twice without TRIM. This provides a good comparison between fresh out of box and well-used performance.

For the second round, we perform another secure erase, and then we send it through the two benchmark passes with TRIM enabled. This gives us a total of four results:

  • TRIM disabled, first pass (brand new)
  • TRIM disabled, second pass (well used)
  • TRIM enabled, first pass (brand new)
  • TRIM enabled, second pass (well used)

A detailed account of a round of benchmarking:

  • Only for second round: Install TRIM Enabler and reboot MacBook Pro
  • Start AJA System Test benchmark (benchmark file size 16 GB)
  • Start DiskTester benchmark (block sizes 4 KB and 8 KB)
  • Have DiskTester fill entire SSD with data three times to simulate use
  • Fill entire SSD with video data
  • Take 30-minute break
  • Start AJA System Test benchmark (benchmark file size 16 GB)
  • Start DiskTester benchmark (block sizes 4 KB and 8 KB)

4. Results: AJA System Test And DiskTester

The AJA System Test and DiskTester benchmarks show that the Samsung 840 Pro SSD performs a bit better in the MacBook Pro with TRIM enabled than without it. However, the performance difference is small. Just remember, turning on TRIM isn't just about speed; it's also intended to help reduce write amplification, bolstering endurance.

According to DiskTester, the Samsung SSD in its brand-new state has a sequential read speed (4 KB blocks) of 51.1 MB/s without TRIM, which goes up to 51.5 MB/s with the feature enabled. The results from AJA System Test and the other passes are similar. Conversely, the results also show that the SSD’s performance does profit more from TRIM in a well-used state. This effect is the most pronounced in AJA System Test’s sequential read benchmark, where the data transfer rate increases from 466.7 MB/s to 512.1 MB/s when TRIM is enabled.

AJA System Test

DiskTester

5. Enabling TRIM Is Almost Always Worth It

We've spent a lot of time talking to storage professionals, including some from LSI, who agree that TRIM is beneficial, even when your controller is designed to make the most of free space on an SSD. So, if a SandForce-based drive can see some benefit, so will any other solid-state repository you install. Consequently, it's worth it to get TRIM working, even when Apple tries to keep you from the command artificially.

To what end does TRIM matter? Well, our AJA System Test and DiskTester benchmarks show that the explicit performance gains, even in a synthetic, are pretty small. In the real world, you probably wouldn't notice one way or the other. But sure, turn TRIM on and things speed up a little bit. 

Source: LSI/SandForceSource: LSI/SandForce

More important are the endurance-oriented reasons to keep TRIM turned on. Without the command, your operating system knows when data is deleted, but has no way to tell the SSD's controller. In turn, the SSD keeps moving that information around via garbage collection, unnecessarily programming and erasing the flash memory cells with stale data. This means that, at some point, the SSD will fill up with data, leaving the controller only with over-provisioned flash with which to work. That's seven to 12% of most desktop SSDs, and includes the space for firmware features like bad block replacement.