outcoldman
outcoldman Denis Gladkikh

Macbook: benchmarks for developers

macbook and benchmarks

Few weeks ago I decided to get myself a Macbook. Wanted compact, lightweight Macbook, and good battery life. I started to consider Macbook instead of Macbook Pro, but wanted to be sure that performance will not be a problem. Few years ago I have heard that Macbooks were very slow, but this year Geekbench showed very promising results. So I got it, now I am trying to test it as much as I can to be sure that there are will be no surprises in performance. Also I am comparing performance to other Apple devices I have.

For my tests I used

  1. Macbook (Retina, 12-inch, 2017), 1.4GHz Intel Core i7, 16 GB 1867MHz LPDDR3, Intel Graphics 615 1536 MB, 256 GB SSD
  2. Macbook Pro (13-inch, 2016, Four Thunderbolt 3 Ports), 3.3 GHz Intel Core i7, 16 GB 2133 MHz LPDDR3, Intel Graphics 550 1536 MB, 512 GB SSD.
  3. Mac mini (Late 2014), 2.6GHz Intel Core i5, 8 GB 1600MHz DDR3, Intel Iris 1536MB, 256 GB SSD
  4. iMac (Retina 5K, 27-inch, Late 2015), 4GHz Intel Core i7, 24 GB 1867 MHz DDR3, AMD Radeon R9 M395X 4096 MB, 513 GB SSD.

To make it clear, Macbook Pro is not mine, so I am not looking for another laptop, I am actually considering the only one laptop for myself.

All of them have macOS Sierra 10.12.5 intalled. Both Macbooks have Firevault enabled.

Geekbench

I don’t really trust Geekbench. But my original decision to buy Macbook was based on the results from this website, so I collected benchmarks myself.

No surprises here, you can see detailed results on my profile, and this is a summary

macbook geekbench

iMac has best performance, and Mac mini shows the lowest performance, it is 2.5 years old and had low end CPU. Macbook Pro from the last year shows the same performance as this year Macbook.

Also GPU tests just for reference

macbook geekbench GPU

Blackmagic Disk Speed Test

Used Blackmagic Disk Speed Test to test disk speed

macbook disk speed

This is where I found that I forgot to enable TRIM when I installed SSD drive in Mac Mini 2,5 years ago. So, remember this when you will look on all other charts, it is possible that in some tests Mac mini can show better performance with good SSD drive.

SSD replacement is not very expensive, but process as I remember requires to tear down everything.

Compiling LLVM (Native)

My first test was the compilation of LLVM from sources. The simplest way to do that is to use brew. Before running the test I verified that all dependencies are installed from the output of brew info llvm. To run the test I used time brew install llvm --HEAD, I run it two times, where second time brew used cached git repositories

macbook llvm

Second run

macbook llvm (second run)

HOMEBREW_MAKE_JOBS is set to number of cores of this device (4 for all, except iMac, which has 8)

If you are not familiar with output of time utility, real time is how long it actually took to run the command, user is for how long this utility was scheduled on CPU (sum of all cores), and system is the time of system overhead (not really important for us).

Let’s look first on difference between Macbook Pro and iMac. iMac has CPU speed of 4.0GHz (turbo boost up to 4.2GHz), Macbook Pro has 3.3GHz (turbo boost up to 3.7GHz), their user CPU time is very close, but because iMac has two times more cores it took 2 times less of real time.

Macbook has 1.4GHz speed with turbo boost up to 3.6GHz, but it cannot keep turbo boost for long time. This is why it is 1.6x times slower than Macbook Pro. Geekbench tests are very short, so they reflect mostly turbo boost speed. But long running CPU jobs aren’t showing the same results as Geekbench.

And as you can see Mac Mini showed very good results. Also considering that it has issues with SSD drive.

Compiling ElasticSearch (Java)

For the next test I used Elasticsearch code base from master. I used latest Java 8

$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Also built it two times, first run

time JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/ gradle assemble

macbook java

and second time I rerun the tasks, that time using cached dependencies

time JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/ gradle assemble --rerun-tasks

macbook java second

After that did another run in IntelliJ IDEA, just compiling the elasticsearch engine, showed me very similar pattern

macbook java IDEA

Compiling docker in docker (Virtualization)

Used latest Docker for Mac

Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:31:53 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:51:55 2017
 OS/Arch:      linux/amd64
 Experimental: true

All macs had the same configuration of 2 CPU and 4GB given to Docker for Mac.

At first I built docker development container with time make BIND_DIR=. shell. Results aren’t so interesting, because this command has many dependencies on external services. All macs showed very similar results between 7 and 11 minutes. Macbook was faster than Macbook Pro in this run, so I decided not to share this result, did not want to confuse.

After that I run time hack/make.sh binary inside container

macbook docker

Very good results for Macbook.

Battery test

To test the battery I charged both Macbooks to 100%. Turned the screen brigtness to 100%. Disabled Slightly dim the display while on batery power and Automatically adjust brightness. And compiled llvm again

macbook battery

Macbook run for 1 hour and 10 minutes and took 35% of battery. Macbook Pro run for 51 minutes and took 61% of battery. With Macbook I could run another test with brigtness set to minimum, it run for 67 minutes and took another 32% of battery. Macbook pro could not finish the second run.

To be honest they both showed pretty bad results. When I owned Macbook Pro 15-inch Late 2013 I could easily compile several times similar in size project without any issues. The only problem I had with that Macbook - the discrete graphic. Sometimes Chrome could turn it on and that could drain battery pretty quickly. That was a time when I started to dream about 13-inch Macbook Pro without discrete graphic card. But seems like battery life is getting worse these days, when you run your laptop on full speed.

Summary

Have feedback or questions? Looking for consultation?

My expertise: MongoDB, ElasticSearch, Splunk, and other databases. Docker, Kubernetes. Logging, Metrics. Performance, memory leaks.

Send me an email to public@denis.gladkikh.email.

The content on this site represents my own personal opinions and thoughts at the time of posting.

Content licensed under the Creative Commons CC BY 4.0.