Results 1 to 10 of 27

Thread: Objective comparison between FreePascal/Lazarus and Delphi

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hmmm.. I am beginning to formulate a future research topic idea..

    Figuring out exactly what the "bloat" is in generated executables from both tools. I mean, I know that a lot of FP/Ls exe size is due to debugging info and not using the smart linker. One test form I tossed together (just an app with a single MDI form, a 30-item menu, and about 10 other controls, no actual functional code) generated a whopping 12MB EXE. Of course, I went in and twiddled with compiler/linker settings, and it went down to 1.8MB, but that's still a bit excessive for not a whole lot of code. As a result, I would conclude that either the code is not as "severable" as it should be, or the linker is not as smart as it could be.

    Guess I need to whip out my file analyzer and see what's under the hood.

  2. #2
    Quote Originally Posted by Murmandamus View Post
    As a result, I would conclude that either the code is not as "severable" as it should be, or the linker is not as smart as it could be.
    I think the component set included with Lazarus by default is what makes the EXE so large. In a way, it is similar to Delphi - if you create a simple console application without any GUI whatsoever, the size is very small. In any case this may serve as an advantage; for instance, some applications compiled with VC++ need the VS runtimes to be distributed and installed, while in this case you have a fully stand-alone application. The "bloat" also exists (to a lesser degree) in apps compiled with Delphi XE, so we'd better get used to it.

  3. #3
    Oh yeah, I was aware that Delphi has the same problem. It always has; they even used to include a command-line utility called "W8LOSS.EXE" that scanned the EXE and stripped out some unused stuff the "smart" linker apparently missed. Primarily, it is the VCL which causes the bloat because there is potential for dynamic creation of any components at runtime, so it goes ahead and links it in, just in case.

    Also, of course, all resources are linked into the EXE file.. any static bitmaps in TImageLists, Icons, strings, etc. General GUI data bloat adds its 20 pounds of flab to the EXE as well.

    The one nice thing about it is that it generally is a one-time charge bloat. IE, the file sizes start out larger than you would expect for the basics, but don't balloon out at the same rate. Like you were saying, it more or less includes the equivalent of MSVSCRxx.DLL as part of the EXE, making it easy to pass around the standalone EXEs.
    Last edited by Murmandamus; 11-02-2011 at 01:15 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •