Recent

Author Topic: Question about optimizer improvements in FPC trunk for different targets  (Read 405 times)

fcu

  • Full Member
  • ***
  • Posts: 123
Hello everyone,

I recently downloaded the Free Pascal trunk (x86) version on Windows 7 32-bit and did some benchmarking tests.

I was pleasantly surprised to see that the optimizer has improved a lot and produces very good results compared to older versions.

This made me wonder:

Are these optimizer improvements specific to the x86 target, or do they also apply to other targets, such as ARM64 and other architectures?

In other words, is the current optimizer progress mostly focused on x86, or is it shared across all supported platforms?

nouzi

  • Sr. Member
  • ****
  • Posts: 326
My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12087
  • Debugger - SynEdit - and more
    • wiki
Re: Question about optimizer improvements in FPC trunk for different targets
« Reply #2 on: January 18, 2026, 02:57:57 pm »
Not easy to answer. And probably needs feedback from all those who have contributed to that.

I haven't contributed myself, but am aware of the following
- Lots (by number) of changes to the x386/x86 peephole optimizer. That would be CPU specific. I don't know if similar peephole changes exist for other CPU.
- Some changes to the memory manager, that can have noticeable impact. That should affect all CPU, but I don't know if it is Target (e.g. OS) dependent. Depending on OS memory management may differ (i.e. I could imagine some embedded don't have the same extend...)

In the end, most changes impact only certain code. So even if your target platform had optimizations, that wont tell if your code will be any faster (or otherwise optimized). That you will simple have to test.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6311
  • Compiler Developer
Re: Question about optimizer improvements in FPC trunk for different targets
« Reply #3 on: January 18, 2026, 04:01:54 pm »
Are these optimizer improvements specific to the x86 target, or do they also apply to other targets, such as ARM64 and other architectures?

In other words, is the current optimizer progress mostly focused on x86, or is it shared across all supported platforms?

It's both. There are some generic improvements in the optimizer and there are x86 and some Aarch64 specific improvements.

 

TinyPortal © 2005-2018