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 Machine | AMD Ryzen 7 3700X (8 Core/16 Threads) | 2m14s | 7m31 |
My Lenovo Carbon X1 Laptop | Intel(R) Core(TM) i7-10610U CPU (4 Core/4 Threads) | 6m22s | 15m22 |
My Old Apple Laptop | Intel(R) Core(TM) i5-7360U CPU (2 Core/4 Threads) | 7m13s | 12m33 |
My New M1 Apple Laptop | Apple M1 (4-to-8-ish Cores) | 2m44s | 6m37s |
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 Machine | AMD Ryzen 7 3700X (8 Core/16 Threads) | 0m57s |
My Lenovo Carbon X1 Laptop | Intel(R) Core(TM) i7-10610U CPU (4 Core/4 Threads) | 4m13s |
My Old Apple Laptop | Intel(R) Core(TM) i5-7360U CPU (2 Core/4 Threads) | 5m33s |
My New M1 Apple Laptop | Apple 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.
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….
It’s an Air. I haven’t compared with a Catalina on a VM on the AMD… I’ll give it a go.
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. 🙂
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?
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.
👍 – then the M1 is really impressive.
(Or clang is!)
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.
I never do a “make install” (and don’t really use Macos), so I can’t really say what might be up with that.
Maybe a good 4800H or 4900HS can challenge it?
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
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
?
I don’t actually use any Macos machines for anything (except building software), so I haven’t tried.
Are you building the same thing though? I could compile any project in 0s for my architecture that basically has only one instruction – nop 😉
16G m1 MacBook Pro:
make 51.97s user 8.64s system 94% cpu 1:03.85 total
16G m1 MacBook Pro:
make clean
time make -j16
make -j16 62.77s user 10.30s system 314% cpu 23.258 total
is this fast? slow? medium? I’ve no idea.
16G m1 MacBook Pro:
make distclean
./autogen.sh
./configure –prefix=/opt/emacs –with-ns –disable-ns-self-contained –with-mailutils
time make -j16
make -j16 70.56s user 10.77s system 257% cpu 31.541 total
The relevant benchmark here is “make -j8 bootstrap”.
make -j8 bootstrap 545.81s user 77.60s system 334% cpu 3:06.23 total
Is this fast? Same configuration as above.
new build directory:
git clone https://github.com/emacs-mirror/emacs.git
cd emacs
make -j8 bootstrap 591.06s user 78.40s system 157% cpu 7:06.23 total
That’s slower than on your setup, if I read this right, which is weird.
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.
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.
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.