www.robkerr.com
www.robkerr.com

mobile development, cloud computing and building great software

Rob Kerr
Author

Addicted to coding since writing my first programs for the Commodore computers in the 1980s. Currently working as an independent contractor focused on native iOS development.

Share


Tags


Twitter


www.robkerr.com

Benchmarking Xcode Builds

Rob KerrRob Kerr

I recently started working with a fairly large iOS/Swift code base--one which takes several minutes to complete a full build from a clean folder. Since I have several macOS workstations on-hand, I naturally was curious how they compare in my most common use case--developing Swift iOS applications. Is there one that would give me less time to fetch a cup of coffee during a full build?

The code base

The code base I'm working with for these tests has the following profile:

Swift files: 223

Objective-C files: 6

Storyboards: 35

Xcode version: 8.3.2

Arrangement: One primary target, with two embedded projects.

Test Methodology

The methodology I used was quite simple, and designed around "real life use" of my computers for Xcode development:

  1. Clean the project, manually delete the entire DerivedData folder.
  2. Shut down the computer
  3. Turn the computer back on
  4. Open the project
  5. Select the "generic ios device" target OS, and build the project (measurement #1)
  6. Clean the project, close Xcode, manually delete DerivedData (again)
  7. Launch Xcode, build the project again (measurement #2)

I planned the two trials to record the experience of building a project that isn't currently in a disk cache, then building it again after macOS had the opportunity to keep files in disk cache. As the numbers below bear out, this made virtually no difference for the two SSD-based computers, but made a huge difference for the iMac with the Fusion disk.

For all trials, I made sure the computers were on AC power, no other applications were running--in fact I had done nothing since booting each machine except run XCode to time the tests.

Test Subjects

I ran the test with three different computers, described below.

2015 15-inch (Retina) MacBook Pro Core i7

Test subject #1 is a 2015 MacBook Pro with a Core i7 CPU, SSD and 16GB RAM. This is a pretty standard "developer workstation" that many serious developers would select. Indeed my tests do support this is probably the best balance of power and portability for a developer (of the three test subjects).
2015 MacBook 15

2015 27-inch (5K) iMac Core i5

Test subject #2 is a 2015 iMac with a Core i5 CPU, Spinning Fusion drive and 32GB RAM. This is my "daily driver" development workstation. While a Core i5 machine with a spinning disk may not sound like a natural choice for a developer, the numbers below bear out that this is actually the most performant machine of the three by a decent margin--for this use case. Of course while it has the most RAM, largest screen and most storage, it has zero portability. Trade-offs...

2016 MacBook Pro 13

2016 13-inch MacBook Pro (no touch bar) Core i7

I purchased this machine as a "travel laptop". I love the portability of it, and it's more than adequate for me as a mobile development workstation for short stints. It's especially awesome for use on airplanes and giving presentations. However, I had wondered whether the 2-core i7 made any difference for Xcode builds vs. the 4-core i5 in my "daily driver" iMac, or the 4-core i7 in the 15" MBP. Spoiler alert: it does. It really, really does.

Results

Here's a summary of the system configurations, configuration costs and build timings using each machine with an identical set of code and the same build process.

One note: the fourth row is a computer I didn't test because I don't have one. I included it because that's the system I would need buy if I wanted to trade in my current iMac+13" MacBook pairing. I could make due with a base model upgraded to 1TB storage.

Note: the prices are what I paid for this equipment (or in the case of the 2015 15" which I don't own, its cost new from Apple as of this date).

My observations

What will I buy next time?

Since I primarily work in my office, and travel for business only occasionally, the iMac plus lower end MacBook for the road still works the best for me. A 5K iMac ($2,499) plus a basic 13" MBP for travel ($1,699) costs less than a mid-range 2016 15" MBP ($3,199) plus the 5K UltraFine display ($1,299). Your mileage may vary, but for my purposes the speed of the iMac and the lightest, most coach-class friendly travel machine is the best of both worlds. Plus my livelihood depends on a working computer every day, so having a backup to my primary machine gives me peace of mind.

Rob Kerr
Author

Rob Kerr

Addicted to coding since writing my first programs for the Commodore computers in the 1980s. Currently working as an independent contractor focused on native iOS development.

Comments