Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-12

FPC 3.0 vs 2.6.4 under FreeBSD

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Just wanted to say kudos to the Free Pascal team for doing a GREAT job with FPC 3.0.

I did a couple of tests and the exact same project with exact same compiler parameters is much improved when compiled with FPC 3.0 (vs 2.6.4)

For example. The 64-bit executable size reduced from 2.35MB down to 1.42MB. I used -O2 optimization and the application speed went from 0.35 seconds down to 0.24 seconds for the same task.

So smaller executables and faster executables - awesome work!!

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
Jonas Maebe
to Graeme Geldenhuys

Graeme Geldenhuys wrote on Thu, 17 Dec 2015:

For example. The 64-bit executable size reduced from 2.35MB down to 1.42MB.

It is very unlikely that this difference is primarily due to improvements in compiler code or data generation between 2.6.4 and 3.0. Maybe one of these binaries is stripped and the other not (maybe some default changed on FreeBSD), or one is smart linked and the other is not (maybe the old shipped units were not smartlinkable and the new ones are, or something like that).

Jonas

Graeme Geldenhuys
to Jonas Maebe
Jonas Maebe wrote
It is very unlikely that this difference is primarily due to improvements in compiler code or data generation between 2.6.4 and 3.0. Maybe one of these binaries is stripped and the other not

Nope, the news seems to be that good. ;-)

I used MSEide to compile my project. All units involved are compiled as part of the project (no "packages" with different compiler settings like Lazarus does). All previously compiled units were removed between compilations (compiled units are output to a single directory so makes the task easy). Compiler settings are identical, and so too is the ~/.fpc.cfg file. I simply told MSEide to switch between FPC executables.

I was pleasantly surprised by the outcome too.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Nope, the news seems to be that good. ;-)

I tried with a few projects now, and the executable is always smaller when compiled with FPC 3.0

Here is another example:

-rwxr-xr-x 1 graemeg graemeg 1551040 17 Dec 13:28 docview-2.6.4 -rwxr-xr-x 1 graemeg graemeg 1394688 17 Dec 13:27 docview-3.0.0

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
Jonas Maebe
to Graeme Geldenhuys: Nope, the news seems to be that good. ;-) I used MSEide to compile my project. All units…

Graeme Geldenhuys wrote on Thu, 17 Dec 2015:

Show quoted text 6 lines
On 2015-12-17 13:14, Jonas Maebe wrote: > It is very unlikely that this difference is primarily due to > improvements in compiler code or data generation between 2.6.4 and > 3.0. Maybe one of these binaries is stripped and the other not Nope, the news seems to be that good. ;-)

As mentioned in my original mail, the difference may be due different defaults in the compiler or in the units shipped with it (maybe even specifically to FreeBSD). There really has been no improvement in the compiler or RTL that magically cuts binary sizes almost in half.

Jonas