Running XCode on an external SSD
July 20, 2016 4:14 AM   Subscribe

Compiling files is much faster on my SSD-equipped laptop than on my iMac with a traditional hard drive. I'd like my desktop machine to blaze like the laptop. But I wonder: would this happen with just an external SSD drive and all my files moved over to it? Or would I need to replace the internal drive?
posted by johngoren to Computers & Internet (10 answers total)
 
If you clone your operating system to an external SSD and boot from it, it should be faster than the spinning hard drive. Here's a guide from Macworld on how to do it (although it's for a Mac Mini, same idea.) Some caveats:

* The drive will need to be plugged in and powered constantly.

* It will be limited by the USB interface. I'm not sure which iMac you have, so this could either be USB 2.0 speeds or USB 3.0 speeds.

* I'm not sure which laptop you have, but if it's a newer Mac, their SSDs are insanely fast due to their PCIe interface. An external SSD won't be this speed, but it will still be much better than a regular hard drive.

You might consider putting the SSD directly into the iMac. There are guides on iFixIt for this, as well as kits with the needed plungers to remove the front glass of the iMac.
posted by bluecore at 5:20 AM on July 20, 2016 [1 favorite]


Response by poster: Oops, sorry, I meant would I get a speed boost in XCode if I kept my system on the Imac but relied on the external SSD for source code?
posted by johngoren at 7:20 AM on July 20, 2016


slow compilation (particularly of a large project with many files) is likely due to reading those files from disk. so yes, putting the source files on a faster disk should help. the compiler will be read once from the OS disk and then cached in memory, so the OS disk is not as important.

however, as the post above says, the exact speedup depends on how the disk is accessed. USB 2.0 access is slow and USB 3.0 is often unreliable (ime). but i don't know about macs.
posted by andrewcooke at 7:34 AM on July 20, 2016


Best answer: I have had to do something similar to this - in my case, it was using an external SSD to circumvent onerous virus checking/disk encryption requirements that were turning a 5-minute build into a 50-minute build (Java-based project on Windows, but the principle is the same). It works, but only over a faster interface such as USB 3.0, Thunderbolt, or eSATA. Using an external USB 2.0 drive will make things worse, not better, since the bottleneck becomes the USB interface and not the SSD. The speedup wasn't as much as I would have gotten with an internal SSD, but it was still a noticeable and useful improvement.
posted by hackwolf at 8:25 AM on July 20, 2016 [2 favorites]


Best answer: Theoretically, an USB3.0 connection can provide just above 500MB/sec transfer rates, which is about what you're getting these days from the better-rated SSD drives. If you're running on a Mac, though, you could just get a Thunderbolt enclosure instead. No bottleneck in theory if you go these routes, but be certain that USB2.0 will not be up to snuff, so do go ahead and avoid that.

It is indeed largely the read speed that will factor here; but do consider that the write speed to your output directory, XCode, and your OS may play into your perceived overall performance in non-trivial ways. (In other words: if these three elements remained on your spinning-plate HDD, and it was just the code to be compiled that went to the SSD.) All else equal, I'd move to internalize.
posted by a good beginning at 8:45 AM on July 20, 2016


Best answer: Theoretically, an USB3.0 connection can provide just above 500MB/sec transfer rates, which is about what you're getting these days from the better-rated SSD drives.

Just as an FYI: the SSD drives in the new Mac laptops are PCIe blades that are much faster than standard SATA SSDs. The one in my Macbook Air is ~700 MB/s. Artechnica tested the Retina Macbook Pro's PCIe 3.0 x4 SSD at ~1300 MB/s. A USB 3.0 SSD will still be peppy, of course.
posted by bluecore at 11:08 AM on July 20, 2016


Best answer: Indeed! Agreed. Only the 2.5" & 3.5" SSD drives suitable for an external enclosure will be around that speed, but internals could be and are a faster route to go down. Should one be able to utilize either the M.2 or PCI SSDs, there are definite performance increases to be had, but be forewarned that the motherboard may need to have been a recent model for this to be the case.

Feel free to post your model here if you decide to go at it internally!
posted by a good beginning at 11:53 AM on July 20, 2016


Best answer: Keep in mind that the speed limit in compilation is most often hard drive latency/IOPS, not bandwidth, because you're working with a large number of relatively small files. That's why an SSD gives you such a dramatic improvement: A conventional HDD will give you 60-100 IOPS, while a typical decent SSD gives you 20,000-100,000 IOPS.

If you're looking at benchmarks online to figure out what to buy, 4KB random read and write speeds are a good proxy for IOPS performance and large project disk-bound compilation speeds. Make sure you pay attention to both read and write numbers, since some solid-state drives have horrible write IOPS. Here is a good example; you can see that the Corsair is getting 7.8 write IOPS, which is ridiculously horrible and would make your life bad. It might be fine for other uses, but it'll kill you for compiling.
posted by clawsoon at 11:55 AM on July 20, 2016


Response by poster: Thanks, guys! This really helps. I can't below how much faster XCode compilation is from some random SSD drive I installed in my laptop, as opposed to my new Mac with its glacial "compiling Swift files"..."touching product"...I will be looking into both external and internal replacement.

Thanks especially for the caution on a bottleneck from a slow USB connection.
posted by johngoren at 3:33 AM on July 22, 2016


Response by poster: Holy mackerel, my local authorized Apple reseller is telling me it would cost £1,000 to replace a new iMac HD with a flash version. The fatter, pre-2012 model must have been easier to work with, maybe? Looks like I will be shopping for the right external.
posted by johngoren at 4:42 AM on July 22, 2016


« Older Thunderbird to gmail migration   |   Third Day on Job - Problematic Recommendation... Newer »
This thread is closed to new comments.