Bloated EXEs (reprise)

Re: Bloated EXEs (reprise)

Postby gkuhnert » Mon Jul 24, 2017 1:43 pm

Antonio,
did you mean by "FWH libs replace Harbour errorsys", that the FWH owned errorsys is linked automatically and the size of the .exe can be explained by this?
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Bloated EXEs (reprise)

Postby hmpaquito » Mon Jul 24, 2017 4:39 pm

Enrico Maria Giordano wrote:Please note that I'm not using any Harbour functions in my sample so EXE size should not increase even if FWH redefines any of those.


Allright, but note what increase problem is no a fwh problem or harbour problem: it's a C linker problem from Embarcadero company if you use Borland C++
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Mon Jul 24, 2017 5:27 pm

No, it isn't. If I remove or add an unused lib from the list, the EXE size doesn't change.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bloated EXEs (reprise)

Postby gkuhnert » Mon Jul 24, 2017 8:40 pm

Enrico,

just had a quick look into errsysw.prg and found this comment in it:

Code: Select all  Expand view  RUN
// Note: automatically executes at startup

proc ErrorSys()
    ErrorBlock( { | e | ErrorDialog( e ) } )
return
 


So I assume as it executes automatically at startup and it is fivehx.lib which contains ErrorSys(), it will automatically be linked in, increasing the file size of our .exe
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Mon Jul 24, 2017 8:54 pm

No, I already tried this (read carefully all the messages please!):

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    RETURN NIL


FUNCTION ERRORSYS()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bloated EXEs (reprise)

Postby hmpaquito » Tue Jul 25, 2017 7:30 am

Allright, but note what increase problem is no a fwh problem or harbour problem: it's a C linker problem


Enrico Maria Giordano wrote:No, it isn't. If I remove or add an unused lib from the list, the EXE size doesn't change.

EMG



No, it isn't ?? :shock:

Building exe is task of linker. If exe no decrease on remove lib is a linker problem.

Which is your linker name ?
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Tue Jul 25, 2017 7:43 am

hmpaquito wrote:Building exe is task of linker. If exe no decrease on remove lib is a linker problem.


The linker is forced to link a module if a symbol of that module is referenced in the program. In my sample, no FWH symbols are referenced. This is demonstrated by the fact that the linker doesn't complain if I remove the FWH libs from the list. So we have to find the reason why 2.4 MB of FWH modules are linked but not used. The only reason I can think of is that FWH redefines some of the xHarbour symbols.

hmpaquito wrote:Which is your linker name ?


ilink32. But that's irrelevant.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bloated EXEs (reprise)

Postby hmpaquito » Tue Jul 25, 2017 8:09 am

Can you paste a map file piece ?

Perhap, the trick is searchs map some file symbol in rtl of xHarbour and if founded then they are.

You work es very usefull for found if fwh overwrite some basis rtl functions.

I have a no explicable problem with harbour+ fwh... only if fwh is linking, viewtopic.php?f=6&t=33754&start=0
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Tue Jul 25, 2017 8:51 am

It's almost 1 MB, too much to paste here. Please send me a private message and I will send back the map file to you.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bloated EXEs (reprise)

Postby hmpaquito » Tue Jul 25, 2017 9:42 am

send me your .mak file, pls.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Tue Jul 25, 2017 10:14 am

You can use buildx.bat.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bloated EXEs (reprise)

Postby rhlawek » Tue Jul 25, 2017 7:46 pm

I wanted to share my observations.

First, on WIndows, I use msvc and msvc64 exclusively. Never BCC.

If I compile the sample program as is I wind up with a 650 KB executable.

If I add #include "fivewin.ch" to the top of the sample, but still with no calls at all to FWH code, and no other changes to my build scripts, I wind up with a 3.8 MB executable.

When I write programs that need to run as services I never include any part of FWH as it was not designed to run headless in a service, and will surprise with popups (MsgInfo(), etc. buried in certain classes and functions) where there should never be any desktop interaction. I share this because it is where I first noticed the .exe size differences, but I never thought much about it because the larger was always something destined for the desktop.

Robb
User avatar
rhlawek
 
Posts: 194
Joined: Sun Jul 22, 2012 7:01 pm

Re: Bloated EXEs (reprise)

Postby Antonio Linares » Wed Jul 26, 2017 2:12 am

gkuhnert wrote:Antonio,
did you mean by "FWH libs replace Harbour errorsys", that the FWH owned errorsys is linked automatically and the size of the .exe can be explained by this?


yes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Wed Jul 26, 2017 7:03 am

Antonio Linares wrote:
gkuhnert wrote:Antonio,
did you mean by "FWH libs replace Harbour errorsys", that the FWH owned errorsys is linked automatically and the size of the .exe can be explained by this?


yes


Then why this sample is still 3195904 in size?

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    RETURN NIL


FUNCTION ERRORSYS()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bloated EXEs (reprise)

Postby Antonio Linares » Wed Jul 26, 2017 9:47 am

Please check the linked modules in the map file

there is no other way to know it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: dtussman, nageswaragunupudi and 33 guests