Bloated EXEs (reprise)

Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Sat Jul 22, 2017 2:59 pm

Anybody could tell me why the following sample generates an EXE of 3208192 bytes?

Code: Select all  Expand view  RUN
FUNCTION MAIN()

    RETURN NIL


The same compiled with xHarbour console (without FWH) is 842240 bytes. The difference is surprisingly high.

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 » Sat Jul 22, 2017 5:52 pm

Which libs do you have included? I think the libraries full of functionality make the .exe bigger 8)
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 » Sat Jul 22, 2017 6:02 pm

Only the standard libs: fivehx.lib and fivehc.lib. But please note that I make no call to any of the FWH functions or classes (see my sample). 2.4 MB size bigger is too much for doing nothing, isn't it?

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 » Sat Jul 22, 2017 7:02 pm

It definitely are the fwh-libs. If I comment these file out of the samples buildx.bat, my .exe is 831kb, with these libs it is 3404kb.

The commented lines are:
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib %fwh%\lib\libmysql.lib + >> b32.bc
echo %fwh%\lib\pgsql.lib %hdir%\lib\libpq.lib + >> b32.bc

So, as long as you don't need functionality provided by these libs, you can keep them out of the compiling.
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 » Sat Jul 22, 2017 8:35 pm

Gilbert,

you definitely missed the point. As the linker put a module in the EXE only if at least one of the symbols contained in that module is referenced, why we have 2.4 MB of modules linked to the EXE if it's only an empty program?

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 » Sun Jul 23, 2017 6:44 am

Enrico,

Comparing the generated .map files we can see which modules are getting linked into the EXE
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 » Sun Jul 23, 2017 8:33 am

Antonio,

thank you. I just send the map to your private email. Any thoughts?

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 » Sun Jul 23, 2017 3:29 pm

Enrico,

Please don't link FWH libraries and check the EXE size that you get
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 gkuhnert » Sun Jul 23, 2017 5:31 pm

Enrico,

sorry, I assumed the key fwh libs were a kind of a framework which always would be linked, because this these libs at least for some years now make the exe bigger. (At least from fwh1202 I can confirm with a test I made today: 839kb vs. 1772kb.
The file size with actual fivewin/xharbour is simular to yours: 831kb vs. 3404kb, which I wrote some a little further down.
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 » Sun Jul 23, 2017 6:25 pm

This is something I don't understand:

- fivehx.lib specified to the linker --> EXE size: 3208192
- fivehx.lib do not specified to the linker --> EXE size: 829440

In both cases I get no linker errors! So the sample is not using any of the FWH symbols. Then why the EXE size grows when fivehx.lib is specified but not used?

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 » Sun Jul 23, 2017 8:33 pm

Because FWH libs replace Harbour errorsys
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 » Mon Jul 24, 2017 7:36 am

The following sample is still 3195904:

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 » Mon Jul 24, 2017 12:10 pm

you should review fwh sources one to one searching not static function which reescribe harbour system, in order to understand that size increase.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Bloated EXEs (reprise)

Postby Enrico Maria Giordano » Mon Jul 24, 2017 12:36 pm

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.

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], SantaCroya and 35 guests