MT5 on M1 Apple Silicon

 

If MT5 is installed on an Apple M1 machine will it take advantage of the extra cores?

I refer to MT5 installed under Wine rather than Parallels.

I would like to get an Apple M1 Ultra machine for backtesting if MT5 will use the extra cores as it should greatly reduce backtest speed.

 
The M1 is an ARM architecture. If you run an x86 App on it, it will be run in an emulator environment. This will for sure bring penalty to speed.

The extra cores will be used if you set up the emulator correctly and assign enough cores to it.

I doubt the M1 is a good choice for that task. But maybe I am wrong...
 
Trader_Phil:

If MT5 is installed on an Apple M1 machine will it take advantage of the extra cores?

I refer to MT5 installed under Wine rather than Parallels.

I would like to get an Apple M1 Ultra machine for backtesting if MT5 will use the extra cores as it should greatly reduce backtest speed.

Hi there.  So Dominik was humble enough to suggest he may be wrong. I'm able to say with confidence that his statements aren't quite accurate. The M1 -- and the entire M1 family, more broadly known as Apple Silicon (ASi for short) -- is much more than just an ARM architecture. It's a chip architecture  custom designed and built by Apple, based around the ARM instruction set. That's a significantly different statement. In particular, any Intel software that runs on any of the M1 family, is NOT emulated (more on that in a moment).

There are two factors here, and I'll cover both in probably more detail than you're asking for, but maybe it'll be helpful, if not for you then for anyone else finding this post in the future:


1. Running apps written for Windows (the OS) in macOS (regardless of the chip hardware).

The MetaQuotes (and brokers') downloadable versions of MT5 for Mac run through Wine. Wine handles translating Windows (OS) APIs to macOS APIs to allow the Windows based app to run within macOS. This is all about the operating system software, and nothing to do with hardware or chip architecture emulation of any kind, which is why Wine typically requires an x86 processor (because Windows and Windows apps typically do). This API translation is fast (much faster than any hardware emulation ever is), and works with native or near native performance on Intel Macs. This is what has enabled Mac users to use MT5 on Intel Macs since it was available in that form. From the sound of your question, I'm guessing you are at least familiar with this, if not already using MT5 on an Intel Mac this way.

Incidentally there exists an improvement on that -- an app called Crossover, by a company called CodeWeavers. This is based on Wine and is in fact what MetaQuotes has used to build their standalone package, and as their article on this states, you don't need Crossover to use the Mac MT5 package.  However there are some advantages to using MT5 within the commercial crossover app -- particularly, more flexibility and control, with better integration between the two file systems, and generally more Mac friendly than a raw wine bottle built by it. To use it, you install the Crossover Mac app on your Mac, and then use the Windows MT5 installer to install MT5 into the Wine bottle that Crossover creates. The catch is Crossover is a commercial product, but it's very affordable and if performance (and your time) are important to your EA or whatever else you're doing, then I'd recommend it as a sound investment. I'm not sure if I'm allowed to post third-party links here but that MetaQuotes article links to it so you can get to it from there if you want.  I have no shares or interest in CodeWeavers. I'm just a happy customer of the product myself (using it for MT5).


2. Running apps written for Intel x86 hardware/architecture on Apple Silicon hardware/architecture.

This is the issue Dominik refers to, of course, and it's more specifically the issue you're asking about. There are now two types of Mac apps: Intel Mac apps, and Apple Silicon (ASi) Mac apps. They each generally start from the same source code and are simply compiled for each of the two different architectures. Actually there's a third type that contains the compiled binaries of both (Intel and ASi) code in one package. These are called "Universal" Mac apps. Today most Mac apps are Universal. Wine, and Crossover, loosely, are both Mac apps compiled for Intel x86 Macs (and Linux and other OS's on x86 also). There is no native ASi (or Universal) Wine or Crossover that I'm aware of. Codeweavers has an article about this on their website, relating to their future roadmap, and it includes some comments on where Wine fits into that.

So to run a Mac app natively on ASi, you need the ASi compiled (or Universal) version. And if you have that, it runs blazingly fast. But if you don't, so for Mac apps that are compiled for Intel Macs only -- including Wine (and by extension, Crossover) -- Apple includes on ASi Macs a thing called Rosetta 2. This is software that allows you to run Intel Mac apps on ASi Mac hardware. It doesn't emulate anything. It TRANSLATES Intel Mac app binary code into ASi app binary code. Sounds like the same thing perhaps, but one key difference is: while it does some of this on the fly all the time, it does most of it the first time you run the Intel app -- it translates (most of) the entire app into native ASi binary code (while it's launching the first time, which means it takes noticeably longer to launch that first time). It then saves that into the app and then runs that (the newly translated ASi binary code). The next time you run it it already has the translated ASi code so it runs that without having to do anything more, so then it both launches and runs near natively. From there, in practice, the sheer performance of the ASi chips, which is significantly greater than all but the most high end power hungry Intel chips, means they run Intel Mac apps faster in this pseudo translated mode on ASi Macs, than they run on Intel Macs.


My own personal experience

Over the last couple of years I've been running MT5 on these three MacBook Pros (MBPs), respectively, at first the standard downloadable Wine-based MT5 package, and then through Crossover. All three MBPs are the max specs I could get:

1. 2019 16" 2.4 Ghz 8-core Intel i9, 64GB RAM

2. 2020 13" 8-core (4+4) M1, 16GB RAM

3. 2021 16" 10-core (8+2) M1 Max, 64GB RAM

I also have a friend with the 2019 13" quad core i5 (Intel) MBP with 16GB RAM. This is essentially what the 2020 M1 MBP (#2 above) replaced in Apple's product line, while #3 above replaced #1 above in Apple's product line.

I haven't done anything particularly intensive with MT5 so I can't speak to how it handles multi-core work on any Mac, but I can say for sure that if it uses all the cores on an Intel Mac then it uses all the cores on an ASi Mac.

What else I can say is that the M1 is Apple's entry level Silicon, and my experience with that is it wipes the floor with my friend's i5. My experience has also been that my $1800 M1 is marginally faster than my $6,000 Intel i9, for all but the most memory intensive apps and tasks. It (the M1) choked a bit when I gave it far too much tick data to work with, while the 64GB i9 MBP handled that just fine.  It was entirely a memory issue. When I got the M1 Max (with 64GB RAM like the i9) a few weeks ago, I've found it noticeably significantly faster at pretty much everything -- like it does most intensive tasks in about half the time, give or take -- compared with the i9... even when running Intel apps (including MT5 / Crossover).


So the short version of all this is two things:

1. The M1 architecture (all variations of it) is based on ARM, but Mac apps compiled for Intel Macs (including Wine and Crossover) are (mostly) translated, once, into native M1 code and then run near natively. That's Apple's spiel, but my experience agrees: Anything I throw at both my 16" 64GB machines (i9 and M1 Max), including Intel apps, performs significantly faster and better on the M1 Max than it does on the i9. And as I'm sure you know an M1 Ultra is basically two M1 Maxes stitched together. So your Ultra will wipe the floor with my Max. 😊 

2. I don't know anything definitively about Wine or Crossover and how well they use all the cores, however I do know that (a) through Wine or Crossover, if something uses all cores on an intel Mac then it will use all cores on a ASi Mac, and (b) from what I can tell from the Crossover website, for any given Windows app, Crossover (and Wine) do make use of at least as many cores on a Mac for the app, as the same app does on a Windows PC, (c) I can say that when I'm running MT5 on my Mac I see multi-core activity.  I can't be sure it's not MT5 using one while other processes are using the rest but I'd bet it's MT5 using them. Also (d) consider this comment -- not the same scenario, but insightful I think, and lends to the idea that MT5 has no trouble with multiple cores on an M1 Mac.


Conclusion

So... while you still don't get any kind of native Mac UI, I can't see any reason why you wouldn't get outstanding performance running MT5 on an M1 Ultra with it using multiple cores.

MetaTrader 5 on Mac OS
MetaTrader 5 on Mac OS
  • www.mql5.com
Apple products have become very popular. MetaQuotes Software Corp. attentively follows the progress of the IT industry and has already released the special mobile applications for iOS-based devices - MetaTrader 4 for iPhone and MetaTrader 5 for iPhone. There are many topics on MQL5.community forum, where people are seeking a solution for running MetaTrader 5 under Mac OS operating system. In this article, you will find out how to work with MetaTrader 5 via the Apple's popular operating system.
 
Yes, I see you dug deep on this...
Still, x86 is a CISC architecture and ARM is a RISC structure. They are fundamentally different.
Even if the total execution from start to end is faster on an M1 chip, it is not native compatible. There will be performance penalty. Even if the "transcompilation" of a binary is possible, the compiler optimization is lost in the process. There are functions and calls which need to be emulated.
I would guess it's just a matter of time until the M1 gets outperformed by either AMD, Intel or in future Nvidia.
Good reply of yours. Thank you for all the details.





 

Thanks David. An awesome post full of product info and, equally worthwhile, experience!

I had already read the post you linked to. I would prefer to avoid Parallels and Windows if possible but the multi-core aspect you mentioned is interesting.

You guessed correctly that I am aware of Crossover. I used it many years ago. I agree with you, if something brings meaningful benefits it is a worthwhile investment.

I was aware of Rosetta 2 but not in the detail you gave, which was helpful. It sounds like Rosetta + Crossover may deliver good speed improvements.

It is really interesting what you said about M1 variants and RAM. I will take this onboard when I order a new machine.

They only question left is will MT5 Crossover use multi-core. From what you said it sounds like it may do or, if not, Apple Silicon with sufficient RAM will still deliver good speed increases.

Many thanks for all the information and perspective you gave. It helped me and, as you mentioned, I am sure it will help others reading in future.

 

Thanks for your thoughts too Dominik. I understand what you say about the chip design differences. I would prefer Apple silicon so if I can get good performance benefits over where I am now I would be happy. Although, human nature being what it is, it won't be long until I am looking for faster still and I will cross that bridge when I get there. By that time the landscape may be different as things seem increasingly competitive with chip design, which is a good thing for customers.

Reason: