As an experiment for CompactSysUtils project I started a while ago, I have used 
this
opportunity to demonstrate why FPC should reorganize the FPC sysutils unit for 
better
smartlinking (i.e. create just one more unit than just sysutils to take care of
smartlinking).

Many functions in the FPC sysutils unit do not rely on any finalization or
initialization code.

By simple copy and pasting some of the sysutils functions into a unit of my own,
called CompactSysUtils, I have gotten the DLL down to 40KB which was previously 
91KB

Project files showing 40KB DLL versus 91KB DLL is here:
http://z505.com/pascal/MD5Hash/MD5Hash_COMPARE.zip

CompactUtils and CompactSysUtils project is here:
https://opensvn.csie.org/pspcgi/psp-lib-1.5.0-devel/src/extras/CompactUtils/

In order to compile the CompactUtils version in that zip file, you will need the
latest copy of the compactutils.pas and compactsysutils.pas which is located on 
the
SVN link above.

Sometimes we don't worry so much about bloat like this since "today's 
processors are
getting faster", but this one is a no brainer. There is no work to be done 
other than
copy/paste functions and reorganize them such as I have done with 
CompactSysUtils
project. I have also made notes about this before on the mailing lists, such as
mentioning how the findpart function can be cut copied and pasted right out of 
the
StrUtils unit so that no sysutils initialization and finalization is hauled in.

Maybe people can learn from this with the lazarus project too - as I'm guessing 
some
(not all) the reason lazarus exe's are so big is because or simple
initialization/finalization bloat. Sure there are abstraction bloat that is 
incurred
for multi-platform programming in SOME CASES, but I've just proved with above
CompactUtils project that abstraction has nothing to do with the majority of the
bloat in this case. Rather simple reorganization in this case, to cut the EXE 
and DLL
in half (actually, *more* than half).

So either I continue to maintain this compactutils project with my elite
cutting/copying/pasting skills or the FPC team decides to reorganize sysutils 
at the
distribution level (i.e. kill the compactutils project and just do it in the RTL
itself). Also anyone wishing to participate in this compactutils project I
started is welcome - I started it to gain smartlinking knowledge myself and I'm 
sure
others could benefit from knowing more about smartlinking.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to