Rust development on Apple Silicon M4? Can we test the incremental build speed?

I am considering buying a new Apple M4 even though I have always hated Apple systems.

But it seems that the Single and Multi core speed is impressive beating every Intel and AMD processor for laptops and desktops.

How do you program in Rust on Apple Silicon? How are we doing with VM, Docker, Visual Studio Code, JetBrains, PostgreSQL and other various tools?

Is the incremental build compilation fast?

Is there a unique project (maybe a script on Github) that we can use to test the incremental compilation speed on various systems?

This way we could test various machines to understand what is better to buy.

Sorry, I'm having trouble understanding where some of these questions are coming from. I get that you "hate Apple systems", but that doesn't mean they are useless or incapable of running common, portable software. Trust me, I do not mean to sound condescending. The answer to most of these questions is "just install the software and use it".

You do have some more interesting questions though, which I will try to answer:

In my experience, the build performance on Apple Silicon is wildly impressive. My laptop (16-core M3 Max) outperforms my desktop CPU (5900X), consistently taking about half the time to compile Rust projects of all sizes.

Not that I know of, but it would have to test several cases where incremental compilation matters. Large number of small crates, small number of large crates, mixtures of both. It would also need tests to show differences between large types and small types, and many monomorphizations vs dynamic dispatch, maybe tests for feature flags, among others. It would probably need a matrix of these tests showing how different combinations are affected.

CPU benchmark comparisons are already a good analog for estimating relative performance.

1 Like

Mac Book Pro M1 user here. Yes, everything just works. Most installation and behaviour is everything you would expect from Linux.

Whilst not having hate for anything Apple I had just ignored them since forever. I had been using Linux on PC's and laptops since 1996. Most of what I want to do works as well on the Mac as Linux. There is some kind of Unix under the hood after all.

Probably the fastest machine I have ever owned. Very light weight and amazingly long battery life. I can even run it from my little mobile phone charger!

By the way I use vim, VScode or Zed for editing Rust. All the usual things just work, PostgreSQL, and so on.

However the Docker containers I make on the Mac do not work on Intel servers in the cloud. I presume there is a way around that, I have not looked into it yet.

As for which machine to buy, I'm not sure raw speed is the crucial criteria. For example I have my machine as a result of balancing cost, weight, screen sized and so on.

1 Like

valgrind does not work - perf is for linux only - but in general Apple is fine and not so different - it's unix.

1 Like