[fpc-pascal] Compilation speed on Apple M1

Florian Klämpfl florian at freepascal.org
Sun Nov 22 12:08:34 CET 2020

> Am 22.11.2020 um 11:45 schrieb Michael Van Canneyt via fpc-pascal <fpc-pascal at lists.freepascal.org>:
>> On Sun, 22 Nov 2020, Florian Klämpfl via fpc-pascal wrote:
>>> Am 21.11.2020 um 12:54 schrieb Tobias Giesen via fpc-pascal:
>>> Hello,
>>> first and foremost, many thanks to the creators and contributors of FPC
>>> and Lazarus, who enabled me to release my product natively for Apple
>>> Silicon only one day after receiving an M1 Mac. Fantastic work! FPC and
>>> Lazarus both run natively and work very well.
>>> According to Geekbench, the single core performance on the new Mac is
>>> around 1.8x as fast as my Intel Mac. Multicore is also much faster. I
>>> wonder why I don't see the speed increase in compiling though. Yes I am
>>> using different FPC and XCode versions, but I wonder what else could
>>> have an influence? My project is very large and not divided into
>>> packages, so I frequently need to recompile the whole project.
>>> I would be most grateful for any performance tips.
>> In r47526, I implemented support of the prefetch intrinsic on aarch64. On my Raspi4 it reduced make cycle time by 25 % (!). I would be very interested to get numbers for the M1.
> 25% ?!

Yes. I were also baffled and tested several times but numbers didn‘t change. This is why I would like to see numbers from others.

> Well... If the compiler can make such a difference,

This are the big low hanging fruits, their are only a few :) In particular the compiler benefits a lot from this as it iterates linked lists a lot.

> should we still bother with micro-optimizations in code then ?

I am always against micro-optimising code, this should do the compiler though prefetch is also a matter of inserting the intrinsic in your code. FPC can do this automatically but so far it is disabled as it is overall not beneficial.

> Michael._______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

More information about the fpc-pascal mailing list