GNAT Speed Comparison on Older Intel versus Apple Silicon M1

87 views
Skip to first unread message

Jerry

unread,
Nov 8, 2022, 11:07:33 PM11/8/22
to
I use GNAT on a late 2008 MacBook Pro with a 2.4 GHz Intel Core 2 Duo for heavy numerical computing. It is not uncommon for my programs to run several minutes to several hours. Does anyone have a feel for how much speed increase I would see using GNAT on an Apple Silicon M1 PowerBook Pro? My main curiosity is single-core runs since GNAT does not parallelize; I am aware that I can run multiple programs simultaneously on multiple cores.

Jerry

Fernando Oleo Blanco

unread,
Nov 9, 2022, 2:38:51 AM11/9/22
to
Hi Jerry,

taking the results from Geekbench: [1] for your current MacBook and [2]
for the M1 MacBook from 2021; the results show that single core
performance of the M1 MacBook Pro is about 6.4 times faster.

However, notice that it is running on Aarch64 natively for the M1.
Nonetheless, you can run x86 programs with little performance hit thanks
to Apple Rosseta.

Also, GNAT afaik, allows for parallel computations using tasks. The
multicore performance gain between the two models is about 24x.

There results are however just an average. Maybe your program does not
see such improvements as it may bottleneck earlier or it may see greater
gains.

Regards,

[1] https://browser.geekbench.com/macs/macbook-pro-early-2008
[2] https://browser.geekbench.com/v5/cpu/18518008

--
Fernando Oleo Blanco
https://irvise.xyz

Stephen Leake

unread,
Nov 9, 2022, 8:52:30 AM11/9/22
to
The recent standard Ada 2022 has more support for fine-grain
parallelization, but it still requires adding syntax to the code.

--
-- Stephe

Jerry

unread,
Nov 10, 2022, 1:26:19 AM11/10/22
to
On Wednesday, November 9, 2022 at 12:38:51 AM UTC-7, Fernando Oleo Blanco wrote:
> Hi Jerry,
>
> taking the results from Geekbench: [1] for your current MacBook and [2]
> for the M1 MacBook from 2021; the results show that single core
> performance of the M1 MacBook Pro is about 6.4 times faster.

That's a great site. Thanks. Clicking around a bit I was able to find separate comparisons for single-core floating point and the speed-up is 5.2.
>
> However, notice that it is running on Aarch64 natively for the M1.

GNAT compiles to Aarch64 now, right?

> Nonetheless, you can run x86 programs with little performance hit thanks
> to Apple Rosseta.

"little performance hit" compared to Intel code running on Rosseta versus Intel silicon or compared to native ARM? And I wonder how long until Apple takes away Rosseta this time? Last time it was two OS updates and then, poof, gone.

Simon Wright

unread,
Nov 13, 2022, 11:30:04 AM11/13/22
to
Jerry <list_...@icloud.com> writes:

> GNAT compiles to Aarch64 now, right?

You can download an aarch64-apple-darwin21 compiler for C, C++, Ada at
[1]. However, it won't compiler C (or, I guess, C++) on Ventura - I'm
working on a GCC 12.2 version.

[1] https://github.com/simonjwright/distributing-gcc/releases/tag/gcc-12.1.0-aarch64-1
Reply all
Reply to author
Forward
0 new messages