Recent

Author Topic: 6MB for "Hello World"?  (Read 12522 times)

CyberDog

  • New member
  • *
  • Posts: 8
6MB for "Hello World"?
« on: March 18, 2006, 11:53:14 am »
Hi Lazarus experts,

I just compiled a new Lazarus project with only one "Hello World" button on it's main window. It resulted in a project1.exe with 6MB. I hope the exe could be much smaller, but I didn't find the settings to get rid of overhead (debug info etc.).

Can someone help?

Thanks, CyberDog

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538

CyberDog

  • New member
  • *
  • Posts: 8
RE: 6MB for "Hello World"?
« Reply #2 on: March 18, 2006, 04:02:50 pm »
Hello sekel,

when do you think will this linker problem be fixed? Or do you have an estimation when the new internal linker will be ready? For the moment we could live with "strip" and we use ASPack as a shrinker for our current Delphi EXEs anyway. What EXE file size would you expect having a project of 100000 or 200000 lines?

Thanks again

CyberDog

CyberDog

  • New member
  • *
  • Posts: 8
RE: 6MB for "Hello World"?
« Reply #3 on: March 18, 2006, 04:09:27 pm »
Or another question: Would you prefer to develop under Windows or under Linux? Maybe the turn-around-times are better there?

Thanks for your time and advice,

CyberDog

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: RE: 6MB for "Hello World"?
« Reply #4 on: March 18, 2006, 06:45:52 pm »
> when do you think will this linker problem be fixed?

I have no idea =) The GNU Linker is part of the GNU project and I have no involvement with it, but I´m kind of tired of it´s many problems on Windows (Path problems, slow, strip problem), so I´m not optimistic about it.

> Or do you have an estimation when the new internal linker will be ready?

My wild guess is 6 months. It is reported to already create executables without problems, but many features need to implemented before we can use it to substitute the Gnu linker. The code for the internal linker is under progress and can be found here:

http://www.freepascal.org/cgi-bin/viewcvs.cgi/branches/linker/

> For the moment we could live with "strip" and we use ASPack as a shrinker for our current Delphi EXEs anyway. What EXE file size would you expect having a project of 100000 or 200000 lines?

Sorry, I have absolutely no idea =)

> Or another question: Would you prefer to develop under Windows or under Linux? Maybe the turn-around-times are better there?

The GNU Linker works very well under Linux, so it´s infinitely faster the compile/link process under Linux.

This is a good reason to prefere to develop under Linux =) You will still want to test the software under Windows just to be sure, but most code should work without changes on both platforms.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
RE: Re: RE: 6MB for "Hello World"?
« Reply #5 on: March 18, 2006, 06:54:40 pm »
In case you want to take a look at a multiplatform software created with Lazarus that was ported from Windows, see the Virtual Magnifying Glass:

http://magnifier.sourceforge.net/

The source code is available via CVS or as a zip file. It compiles with Delphi or Lazarus 0.9.12

CyberDog

  • New member
  • *
  • Posts: 8
Developing under Linux
« Reply #6 on: March 19, 2006, 04:00:47 pm »
Hello sekel,

thank you for your info. I think we will give Lazarus a try. All other possibilities are either too slow (Java) or combined with a port to another language (C/C++ and Qt or Java and Eclipse). Kylix is discontinued.

Best regards, CyberDog

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Re: Developing under Linux
« Reply #7 on: March 20, 2006, 10:16:50 am »
Quote from: "CyberDog"
Hello sekel,

thank you for your info. I think we will give Lazarus a try. All other possibilities are either too slow (Java) or combined with a port to another language (C/C++ and Qt or Java and Eclipse). Kylix is discontinued.

Best regards, CyberDog


I'm a fan of Free Pascal/Lazarus and the Open Source idea, but to be fair, in fact there are more alternatives to port Delphi code to multiple platform. E.g. the (commercial) Chrome product copmiles Delphi language code and uses a VCL-alike API interface. The .NET code it produces is said to run as well on native .NET Windows as on Mono/Linux (and supposedly on Mono/Windows). It uses the MS Visual Studio as an IDE.

Moreover CrossKylix looks like an intersting alternative for your purpose.

(Hoping to see this project successfully done with Lazarus... Please keep us posted in any case.)
-Michael

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Developing under Linux
« Reply #8 on: March 20, 2006, 01:18:38 pm »
Quote
Chrome product copmiles Delphi language code and uses a VCL-alike API interface. The .NET code it produces is said to run as well on native .NET Windows


Some things about the performance of .NET:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=fpascal&lang2=csharp

http://www.microsoft-watch.com/article2/0,1995,1820607,00.asp

FPK

  • Full Member
  • ***
  • Posts: 118
RE: Re: Developing under Linux
« Reply #9 on: March 20, 2006, 09:11:12 pm »
A rough estimate is 10 bytes per line of code. A basic lazarus hello world program contains already a lot of framework code that's why it is stripped around 700 kB, so I guess a 200k line project will be 3-4 MB depending on the 3rd party units it's using.

CyberDog

  • New member
  • *
  • Posts: 8
Linker fix
« Reply #10 on: June 09, 2006, 01:21:30 pm »
Hello,

does anybody know when the linker problem might be fixed? Are the linux executables so big as well?

CyberDog

Anonymous

  • Guest
RE: Linker fix
« Reply #11 on: June 19, 2006, 12:26:10 pm »
1. Compile lazarus with make smart
2. use strip
3. use upx, ASPack and so on

 

TinyPortal © 2005-2018