Recent

Author Topic: Huge size of executables on Win32  (Read 10968 times)

GreenWyvern

  • Newbie
  • Posts: 3
Huge size of executables on Win32
« on: April 04, 2010, 04:38:22 pm »
Hi,

I'm an experienced, long-time Delphi programmer, but a newbie to Lazarus and Free Pascal. Please excuse me if this is a question which has been answered many times, but after searching and reading a bit, I couldn't find any obvious answer.

After downloading and installing the Lazarus package on Windows 32, I created a test program consisting of a form with a button and a label on it, and got a 12MB exe.

I've looked at the FAQ and various pages about smart linking and optimizing size, and I've rebuilt Lazarus with -CX -XX options, and recompiled the test program and it doesn't make any difference.

Maybe I'm missing something obvious. Any advice?

Thanks!
« Last Edit: April 04, 2010, 04:52:51 pm by GreenWyvern »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933

GreenWyvern

  • Newbie
  • Posts: 3
Re: Huge size of executables on Win32
« Reply #2 on: April 04, 2010, 05:09:17 pm »
Thanks!

Now it goes down to 1.7MB, and to 600k after compressing with PECompact. Still big by Delphi standards, but not too bad.

I didn't realize that the debug info could be so huge on FP.  :(


eastorwest

  • New Member
  • *
  • Posts: 17
Re: Huge size of executables on Win32
« Reply #3 on: April 04, 2010, 10:38:15 pm »
GreenWyvern
If you want to make little programs for Windows OS you could use KOL library instead of LCL (read this about it http://wiki.lazarus.freepascal.org/KOL-CE)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Huge size of executables on Win32
« Reply #4 on: April 05, 2010, 02:01:14 am »
You could simply unmark "Show Line Numbers..." in Compiler Options, Linking tab.

fredycc

  • Sr. Member
  • ****
  • Posts: 264
Re: Huge size of executables on Win32
« Reply #5 on: April 05, 2010, 04:15:15 am »
Hi, the next tool is fantastic to me is from Marien's Homesite search for makemesmall, this works from exe, dll, so, and others types, i have reduce files for windows, mobile and dll or so (linux). Just download, compile into lazarus & follow the instructions. :)

http://members.home.nl/mvanwesten/en_lazarus.html

GreenWyvern

  • Newbie
  • Posts: 3
Re: Huge size of executables on Win32
« Reply #6 on: April 05, 2010, 08:09:18 am »
Thanks for the replies!  :)

Quote
If you want to make little programs for Windows OS you could use KOL library instead of LCL (read this about it http://wiki.lazarus.freepascal.org/KOL-CE

Looks interesting, but seems to have a limited set of controls.

Quote
You could simply unmark "Show Line Numbers..." in Compiler Options, Linking tab.

Reduces size from 12MB to 3.7MB, but then strip doesn't seem to have any further effect, so the end result is larger than the 1.7MB I was getting before.

Quote
Hi, the next tool is fantastic to me is from Marien's Homesite search for makemesmall,

This just does a strip and UPX.

Apart from the size issue, the result of my evaluation is that while FPC/Lazarus has some nice features, Delphi 7 is still immeasurably better in every way for creating professional-quality applications. However, FPC/Lazarus may still be very useful for small and relatively simple cross-platform applications, which I guess is the intention.
 

Zoran

  • Hero Member
  • *****
  • Posts: 1980
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Huge size of executables on Win32
« Reply #7 on: April 05, 2010, 08:10:41 am »
Hi, the next tool is fantastic to me is from Marien's Homesite search for makemesmall, this works from exe, dll, so, and others types, i have reduce files for windows, mobile and dll or so (linux). Just download, compile into lazarus & follow the instructions. :)

http://members.home.nl/mvanwesten/en_lazarus.html

This makemesmall tool uses strip and upx utilities. You should not always use upx, read this: http://wiki.lazarus.freepascal.org/Size_Matters
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Huge size of executables on Win32
« Reply #8 on: April 05, 2010, 02:50:18 pm »
Smartlink ALL units you use, that would give you 1.2~1.3 MB. UPX drops it to about 400K.

José Mejuto

  • Full Member
  • ***
  • Posts: 136
Re: Huge size of executables on Win32
« Reply #9 on: April 05, 2010, 03:36:06 pm »
[...]
Apart from the size issue, the result of my evaluation is that while FPC/Lazarus has some nice features, Delphi 7 is still immeasurably better in every way for creating professional-quality applications. However, FPC/Lazarus may still be very useful for small and relatively simple cross-platform applications, which I guess is the intention.

Hello,

Apart from the size issue, the rest of the message sounds quite offensive for Lazarus developers and users. The same could be inversed, Delphi 7 is a nice toy 'cos professional-quality software should be able to run in most important platforms.

Would be nice to see where Delphi 7 is "inmeasurably better".

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Huge size of executables on Win32
« Reply #10 on: April 05, 2010, 04:10:07 pm »
Delphi 7 is still immeasurably better in every way for creating professional-quality applications.

I think you cannot have everything, so one has to prioritize. The main objective of the Lazarus & FPC teams was to create a cross-platform RAD tool that is similar to Delphi, rather than to replicate Delphi. You may have noticed that there are things you can do in Delphi but not in Lazarus/FPC (because there is no obvious way to make them work cross-platform) and things that you can do in Lazarus/FPC but not in Delphi (e.g., develop 64-bit applications). On the other hand, if you are "immeasurably" happier with Delphi, why would you bother trying to learn FreePascal?

Check out the Lazarus/FPC application galleries: is, say, MRIcroGL the kind of "small and relatively simple application" you were talking about? Please try to put things into perspective and be more constructive when posting to these forums.
« Last Edit: April 05, 2010, 05:26:30 pm by Troodon »
Lazarus/FPC on Linux

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12634
  • FPC developer.
Re: Huge size of executables on Win32
« Reply #11 on: April 10, 2010, 03:16:56 pm »
FPC/Lazarus may still be very useful for small and relatively simple cross-platform applications, which I guess is the intention.

I think FPC/Lazarus being written in itself disspells that myth.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
Re: Huge size of executables on Win32
« Reply #12 on: April 11, 2010, 11:00:59 am »
FPC/Lazarus may still be very useful for small and relatively simple cross-platform applications, which I guess is the intention.

I think FPC/Lazarus being written in itself disspells that myth.

Something you cannot say about Delphi ;)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018