The Only M1 Benchmark That Matters

I’ve got a new Apple laptop, so I thought I’d do an Emacs build benchmark. Building Emacs is what people do on computers, right? At least if I extrapolate from myself, which is the only natural thing to do.

It’s called proof by induction. Look it up, nerds.

So here’s the benchmarks:

My Main Build MachineAMD Ryzen 7 3700X (8 Core/16 Threads)2m14s7m31
My Lenovo Carbon X1 LaptopIntel(R) Core(TM) i7-10610U CPU (4 Core/4 Threads)6m22s15m22
My Old Apple LaptopIntel(R) Core(TM) i5-7360U CPU (2 Core/4 Threads)7m13s12m33
My New M1 Apple LaptopApple M1 (4-to-8-ish Cores)2m44s6m37s

The next-to-last column is with -jTO-THE-MAX, and the last column is with -j1.

I’m impressed! The M1 is able to build Emacs almost as fast as my AMD machine… which is a lot bigger.

Of course, on Debian I’m using gcc and on Macos I’m using clang, so it’s an apples-to-some-different-brand-of-apples comparison.

It’s even more impressive how much faster this laptop is compared to the Apple laptop from… 2019? Yeah. It’s more than twice as fast! And doesn’t have a fan! The old Apple laptop would sound like a VAX in a hurricane while building Emacs!

And it’s also twice as fast as the laptop I use daily here on the couch; last year’s Lenovo Carbon X1, which is just embarrassing. Lenovo! Get on it! Make an ARM laptop that’s fast!

For the first time in my life, I have Apple envy. That is, for the first time ever, they’ve made a laptop that’s clearly superior to what’s available for us Linux peeps. My only comfort is that the Apple keyboard still sucks. Yeah! And it doesn’t have a TrackPoint! Yeah! My laptop is still the best! Yeah! Take that!

Yeah! I’m not the least envious!

*sniff*

Edit some hours later:

But one thing that would be interesting to look at is Emacs performance on M1 vs the other machines. And a way to broadly look at that is to see how long it takes to byte-compile a bunch of Emacs Lisp files: This exercises much of Emacs, except display-related stuff.

So: Benchmarking with

rm `find lisp -name '*.elc'`; time make -jMAX

I get:

My Main Build MachineAMD Ryzen 7 3700X (8 Core/16 Threads)0m57s
My Lenovo Carbon X1 LaptopIntel(R) Core(TM) i7-10610U CPU (4 Core/4 Threads)4m13s
My Old Apple LaptopIntel(R) Core(TM) i5-7360U CPU (2 Core/4 Threads)5m33s
My New M1 Apple LaptopApple M1 (4-to-8-ish Cores)1m33s

Here the AMD clearly wins over the ARM, but per-core performance is in advantage of the ARM. And, of course, the ARM soundly wins over both of the other two laptops.

26 thoughts on “The Only M1 Benchmark That Matters”

  1. I see we almost share the same Laptops (X1 and MacBook well I will receive it soon)
    1. this is a MacBook Air or Pro, from 2020 I understand?
    2. comparing gcc to clang: did you compare the compilation of your X1 with the installed virtual installed MacOS ?

    I agree with your remarks with the keyboard, besides the X1 has more keys (so more emacs functions to bind….

    1. OK, the Catalina VM on the 8-code AMD machine took 4m35s, but I don’t think that tells us much… I mean, what speed penalty does the VM entail? But it’s faster than the old Apple laptop, so… er… No, no conclusion. 🙂

  2. No fan? I would definitely be a fan of that. But I don’t want to go back to not having three physical mouse-buttons on my laptop, that’s just bizarre.

    How much of the build-time is I/O and how much is CPU? It sounds impressive that the new laptop can keep up with the AMD.

    Can you build Emacs with clang on non-macOS to get the flavours of oranges closer to the apples, or is that just not done?

    1. It’s all NVMe, and it’s all in memory anyway (after running “make bootstrap” a couple of times), so it’s probably 99% CPU. The Emacs build isn’t very parallel, though — about half the time spent is sequential, so on a different build (say, the Linux kernel, which is very parallel), the AMD would win bigly.

      I’ve never tried building Emacs on clang on anything but Macos… is that even possible? I have no idea.

  3. I did the same. One thing I am having trouble with is after `make install`, Big Sur keeps complaining the built app is damaged. (but `make` works and I can run `src/emacs` well.

    1. I never do a “make install” (and don’t really use Macos), so I can’t really say what might be up with that.

    1. So I don’t have X on my laptop so I had to skimp on some build options, but I do have a brand new Ryzen 7 4700H, got it on saturday.

      time make
      real 8m36,881s

      So it’s slower. But with all cores:

      time make -j16
      real 0m25,751s

  4. How does the Macbook feel with the Tex Kodachi keyboard attached,
    perhaps with a glance at System Preferences -> Keyboard -> Input Sources -> + -> U.S.International – PC followed by Keyboard – Keyboard -> Modifier Keys
    ?

    1. I don’t actually use any Macos machines for anything (except building software), so I haven’t tried.

  5. Are you building the same thing though? I could compile any project in 0s for my architecture that basically has only one instruction – nop 😉

  6. I ran it on my AMD Ryzen 7 PRO 4750U (1st gen Lenovo T14). Running Linux on bare metal.

    real 3m3.998s
    user 17m37.181s
    sys 0m45.482s

    But the good portion of the test was spent waiting on a single core to complete its task.

  7. Where to go for chat on emacs on Mac, specifically Mac OS 12.0.1 Monterey and reading files below ~/Library/Messages from within a shell within emacs 27.2? Seems there some magic needed in order to give emacs read permissions.

  8. Terminal.app is permitted to read the files I wanted, and launching emacs from within Terminal.app lets emacs inherit that privilege, which works well enough for me.

Leave a Reply