Archive

Posts Tagged ‘io’

TRIM Speedup on OS X Lion using Full Disk Encryption

November 20th, 2011 1 comment

I was quite surprised to see the speed up achieved by enabling TRIM support on Lion using TRIM Enabler. After I enabled it, I created a big file, deleted it (thus freeing/trimming the no longer used blocks) and rewriting another file of the same size:

jupp@x / > dd if=/dev/zero of=zero bs=1m count=$((6*1024))                                                                                                                                                                                                                                                                            
6144+0 records in
6144+0 records out
6442450944 bytes transferred in 71.336086 secs (90311248 bytes/sec)
jupp@x / > rm zero                                                                                                                                                                                                                                                                                                                      jupp@x / > dd if=/dev/zero of=zero bs=1m count=$((6*1024))                                                                                                                                                                                                                                                                              
6144+0 records in
6144+0 records out
6442450944 bytes transferred in 55.568795 secs (120149352 bytes/sec)

That’s a 1.33 speedup for sequential writing. This should not effect reading, of course. As you can imagine, the benefits for random IO on small blocks will be much higher than that.

This shows that the on-chip garbage collector in the SSD drive is (as expected) unable to do anything if full disk encryption is used, requiring the use of TRIM in order to keep write performance high. However, be warned: the use of TRIM could potentially compromise the invisibility of your main partition if using a fake partition for plausible deniability.

I’m using a MacbookPro6,2 and an Intel SSDSA2CW120G3.

Disclaimer: I’m aware that using dd in this fashion in order to achieve quantitive benchmarking results is not recommended. It was just a quick hack to demonstrate that it’s freakin faster with TRIM.