Author Topic: FreePascal and Lazarus Optimization  (Read 1379 times)


  • Full Member
  • ***
  • Posts: 202
FreePascal and Lazarus Optimization
« on: November 15, 2020, 01:22:54 pm »
It is fantastic that FPC and Lazarus support the new ARM-based Macintosh on launch day. From my persecptive, Jonas (FPC) and Dmitry (Lazarus) have both led and been the public faces of this community effort. Like many of us, Jonas and Dmitry have full time jobs, and their ability to contribute to this community project is limited. In addition, there is still opportunity for optimization for FPC
  a. FPC for ARM can fail when when run at higher optimization levels (as documented on Mantis)
  b. FPC for ARM still has a lot of low-hanging fruit for hardware-specific optimizations.
  c. FPC lacks single assignment that would optimize performance on all platforms (

I want to highlight the work of J. Gareth "Kit" Moreton". He has an established track record for optimizing FreePascal as seen by his commit history on Mantis. His work has included x86-64, ARM and general optimization tricks. The entire community has benefited from his talent. Beyond his outstanding training, he has ability to think differently from most people. This helps him find solutions that are unintuitive to most:
I can also speak personally about Kit’s skillset. He and I worked on SIMD acceleration for the open source MRIcroGL software. He developed SSE and AVX solutions to the primary bottleneck both for integer and floating-point computations. Objectively, his solutions far out-performed my own and I found it insightful to learn a few of his tricks. Indeed, his solutions were so good that the memory bandwidth rather than the computation is the rate limiting factor.

At the moment, Kit is between jobs. I believe that the whole community can benefit if we can help him devote his time to developing optimizations that will help all of us. The optimizations he creates improve the code each of us creates, and will be an enduring benefit for the community. During discussions, Kit has committed to tackling the 3 optimizations described above. Like most of us, he passionately wants to support the community regardless of our support. However, financial aid would give him the ability to focus on these issues and accelerate his progress.

I realize most of us have had financial setbacks and uncertainty due to COVID. This can impact our desire to contribute financially to the open source community. However, if you are able to make a small donation to Kit’s work, I will commit to matching your donation up to $200 per month (such that I will contribute $200 of my own money, if the rest of the community provides $200). Kit is truly a unique asset to our community, and his core compiler work impacts each of us. This is a terrific opportunity for the community to engage the full time efforts of a uniquely gifted developer
Several FPC/Lazarus developers are supported by Patreon, and most post in this forum with signatures that advertise their Patreon site. Kit works behind the scenes, making all of our code better and he tends to keep himself to himself. I have started this campaign because I believe this is a worthy cause. However, Kit has approved the content of this message.


  • Sr. Member
  • ****
  • Posts: 379
Re: FreePascal and Lazarus Optimization
« Reply #1 on: November 15, 2020, 06:26:32 pm »
I don't know Kit, however his ideas, experiments and contributions are great reads and suggest an organized and analytical mind.


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1442
  • Former Delphi 1-7, 10.2 user
Re: FreePascal and Lazarus Optimization
« Reply #2 on: November 16, 2020, 04:56:57 am »
I added a small amount to the cause.
Lazarus 2.1 r65061 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65070 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM


  • Hero Member
  • *****
  • Posts: 1284
    • UVviewsoft
Re: FreePascal and Lazarus Optimization
« Reply #3 on: December 25, 2020, 09:05:42 am »
I subscribed+donated.


  • Hero Member
  • *****
  • Posts: 1174
    • formatio reticularis
Re: FreePascal and Lazarus Optimization
« Reply #4 on: December 25, 2020, 11:42:17 am »
Thanks for sharing this information. I just subscribed and donated.

Promoting geniusses like J. Gareth Moreton would be an excellent case for the foundation (in addition to individual contributions, of course).
function GetRandomNumber: integer; //
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.

Lazarus 2.0.12 | FPC 3.2.0 | PPC, Intel, ARM | macOS, Windows, Linux

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 324
Re: FreePascal and Lazarus Optimization
« Reply #5 on: January 03, 2021, 10:15:19 pm »
I subscribed and donated.

Thanks to Jonas and skalogryz for their work!


TinyPortal © 2005-2018