Some Notes and Benchmarks on the Apple M1 Mac Mini
I’ve just received my Mac Mini with an M1 processor, 8 GB RAM, 256 GB SSD. These are some notes made while experimenting with it.
Preparing
Make sure you run Software Update to get the most recent version, currently 11.0.1. If you don’t do this before installing the developer tools then you will have to repeat that.
xcode-select --install
Ubuntu for arm64 is tested using Apple’s built in virtualization framewoork, with a simple UI courtesy of @KhaosT
Set-ups Being Compared
Tests reported here have been run on the following configurations. For relative performance I use the original Zen 1 ThreadRipper as my base, because that’s what I sit at all day every day and other than the number of cores it can represent the two or three year old machine that most people probably use.
Name | System | Cores | RAM GB | Host OS | Environment |
---|---|---|---|---|---|
ripper |
ThreadRipper 2990wx |
32 + HT |
128 |
Ubuntu 18.04 |
x86_64 native |
thinkpad |
ThinkPad E14 Gen 2 Zen 2 4500U |
6 |
8 |
Windows 10 |
x86_64 Ubuntu 18.04 in WSL 2 |
mini |
Mac Mini M1 |
4 + 4 |
8 |
MacOS Big Sur |
arm64 native |
rosetta |
Mac Mini M1 |
4 + 4 |
8 |
MacOS Big Sur |
x86_64 in Rosetta 2 |
minivm |
Mac Mini M1 |
4 |
4 |
MacOS Big Sur |
arm64 Ubuntu 20.04 in VM |
pi4 |
Raspberry Pi 4 1.5 GHz |
4 |
4 |
Ubuntu 18.04 |
arm64 native |
Benchmarks
Perl Summing Numbers Benchmark
This is really trivial, but you can do it in a few seconds on almost any machine. I’ve been using it since the mid-2000s when it used to take 2 or 3 seconds on Pentium IIIs and G4s.
time perl -e 'for($i=0;$i<=1000000;++$i){$t+=$i}print"$t\n"'
System | Time s | Speed |
---|---|---|
ripper |
0.074 |
100% |
thinkpad |
0.051 |
145% |
mini |
0.045 |
164% |
rosetta |
0.057 |
130% |
minivm |
0.041 |
180% |
pi4 |
0.183 |
40% |
Note: Ubuntu in a VM being faster than native is real because Linux is more efficient launching very short-running programs than MacOS. This is also very noticable when running ./configure for open-source software.
Primes Benchmark
I have a simple prime number sieve program I wrote and have been using for a number of years on many different systems I’ve had access to. It only uses 8k of memory so fits into L1 cache on any recent CPU.
Source code with many test results: http://hoult.org/primes.txt
System | Time s | Speed |
---|---|---|
ripper |
3.525 |
100% |
thinkpad |
3.448 |
102% |
mini |
2.795 |
126% |
rosetta |
2.925 |
120% |
minivm |
2.810 |
125% |
pi4 |
12.115 |
29% |
Building the RISC-V toolchain
Building cross-compile GNU binutils, gcc, gdb, NewLib for the RISC-V instruction set
mkdir riscv_bin git clone --recursive https://github.com/riscv/riscv-gnu-toolchain cd riscv-gnu-toolchain ./configure --prefix=`pwd`/../riscv_bin --enable-multilib time make -j`ncpus`
System | Time | Speed |
---|---|---|
ripper |
10m51s |
100% |
thinkpad |
19m57s |
54% |
mini |
- |
- |
rosetta |
39m05s |
28% |
minivm |
15m13s |
71% |
pi4 |
102m28s |
11% |
Note: currently a native arm64 MacOS build of binutils succeeds, but building a cross-gcc is not yet supported.
Note: minivm was allocated 4 GB RAM and 4 CPU cores. The CPU could clearly do better if I could afford to allocate more RAM to the VM. Using more cores caused it to run out of RAM and thrash. Allocating more RAM to the VM made the host MacOS unhappy.
Note: pi4 has a pimorini fanshim.