Executable size question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Executable size question

pianoman-3
Helo everyone, I would like to ask why are exes generated by FPC so big?
Simple writeln('Hi'); has about 28 KB. Old FPC 1.0.0 for example  created
for the same code only 14 kb exe.
What Should I do to reduce the file size (without compression)
Pianoman
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Sunday, January 01, 2006 12:00 PM
Subject: fpc-pascal Digest, Vol 17, Issue 1


> Send fpc-pascal mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fpc-pascal digest..."
>
>
> Today's Topics:
>
>    1.  const pchar parameters? (L505)
>    2. Re:  const pchar parameters? (Jonas Maebe)
>    3.  XML DOM stuff (Tony Pelton)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 31 Dec 2005 11:09:21 -0700
> From: L505 <[hidden email]>
> Subject: [fpc-pascal] const pchar parameters?
> To: FPC-Pascal users discussions <[hidden email]>
> Message-ID: <026001c60e35$59db7d10$0200a8c0@l1>
> Content-Type: text/plain; charset=iso-8859-1
>
> When using pchars, what happens when one does this:
>
> function test(const input: pchar): integer;
>
> Is this a pointer to a pchar? Or is it just a pchar?
>
> i.e. below is bad:
> function test(var input: pchar): integer;
>
>
> So what about a const pchar paramater... Is it a read only pchar, or a
read only

> pointer to a pchar?
>
>
> --
> L505
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 31 Dec 2005 19:17:20 +0100
> From: Jonas Maebe <[hidden email]>
> Subject: Re: [fpc-pascal] const pchar parameters?
> To: FPC-Pascal users discussions <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
>
> On 31 Dec 2005, at 19:09, L505 wrote:
>
> > When using pchars, what happens when one does this:
> >
> > function test(const input: pchar): integer;
> >
> > Is this a pointer to a pchar? Or is it just a pchar?
>
> It can be either of those. The compiler is free to choose what it
> does. All you know for sure is that when you try to assign something
> to "input", the compiler will throw an error.
>
> x
> Jonas
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 31 Dec 2005 19:33:45 +0000
> From: Tony Pelton <[hidden email]>
> Subject: [fpc-pascal] XML DOM stuff
> To: FPC-Pascal users discussions <[hidden email]>
> Message-ID:
> <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> hi all,
>
> i've been toiling over the DOM implementation with the FCL for a few hours
now.

>
> i had successfully used the XMLRead code to load a DOM from an XML file.
>
> i had successfully mutated said document and used XMLWrite to persist
> those changes to the DOM.
>
> i've now been beating my head against the wall trying to figure out
> how to build a DOM "from scratch" in code.
>
> My trouble begins because it would seem that i don't get a "well
> formed" document by doing a straight "Create()" of an TXMLDocument.
>
> i've been digging around inside of the XMLRead code for a bit, trying
> to understand what _it_ does to get a document going from an XML
> source file.
>
> it's confusing to me.
>
> i see some casting and subclassing inside of the XMLRead code that
> seems to allow for the creation of a well formed TXMLDocument, but i
> don't see anything that leads me to a well formed API or "factory" for
> being able to instantiate an "empty" but well formed XML document
> myself.
>
> minimally, i'm having problems because i can't see how to get a
> DocumentElement attached to the DOM instance via a user serviceable
> API call.
>
> so i can't attach any new elements to the document after a Create().
>
> what am i missing ?
>
> tia,
> Tony
>
> ------------------------------
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
> End of fpc-pascal Digest, Vol 17, Issue 1
> *****************************************
>
>
> __________ Informacia od NOD32 1.1347 (20051230) __________
>
> Tato sprava bola preverena antivirusovym systemom NOD32.
> http://www.eset.sk
>
>

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Executable size question

Florian Klämpfl
Pianoman wrote:

> Helo everyone, I would like to ask why are exes generated by FPC so big?
> Simple writeln('Hi'); has about 28 KB. Old FPC 1.0.0 for example  created
> for the same code only 14 kb exe.
> What Should I do to reduce the file size (without compression)

Use 1.0.10 ;)
2.x simply has new features which make executables bigger.

> Pianoman
> ----- Original Message -----
> From: <[hidden email]>
> To: <[hidden email]>
> Sent: Sunday, January 01, 2006 12:00 PM
> Subject: fpc-pascal Digest, Vol 17, Issue 1
>
>
>
>>Send fpc-pascal mailing list submissions to
>>[hidden email]
>>
>>To subscribe or unsubscribe via the World Wide Web, visit
>>http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>or, via email, send a message with subject or body 'help' to
>>[hidden email]
>>
>>You can reach the person managing the list at
>>[hidden email]
>>
>>When replying, please edit your Subject line so it is more specific
>>than "Re: Contents of fpc-pascal digest..."
>>
>>
>>Today's Topics:
>>
>>   1.  const pchar parameters? (L505)
>>   2. Re:  const pchar parameters? (Jonas Maebe)
>>   3.  XML DOM stuff (Tony Pelton)
>>
>>
>>----------------------------------------------------------------------
>>
>>Message: 1
>>Date: Sat, 31 Dec 2005 11:09:21 -0700
>>From: L505 <[hidden email]>
>>Subject: [fpc-pascal] const pchar parameters?
>>To: FPC-Pascal users discussions <[hidden email]>
>>Message-ID: <026001c60e35$59db7d10$0200a8c0@l1>
>>Content-Type: text/plain; charset=iso-8859-1
>>
>>When using pchars, what happens when one does this:
>>
>>function test(const input: pchar): integer;
>>
>>Is this a pointer to a pchar? Or is it just a pchar?
>>
>>i.e. below is bad:
>>function test(var input: pchar): integer;
>>
>>
>>So what about a const pchar paramater... Is it a read only pchar, or a
>
> read only
>
>>pointer to a pchar?
>>
>>
>>--
>>L505
>>
>>
>>------------------------------
>>
>>Message: 2
>>Date: Sat, 31 Dec 2005 19:17:20 +0100
>>From: Jonas Maebe <[hidden email]>
>>Subject: Re: [fpc-pascal] const pchar parameters?
>>To: FPC-Pascal users discussions <[hidden email]>
>>Message-ID: <[hidden email]>
>>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>>
>>
>>On 31 Dec 2005, at 19:09, L505 wrote:
>>
>>
>>>When using pchars, what happens when one does this:
>>>
>>>function test(const input: pchar): integer;
>>>
>>>Is this a pointer to a pchar? Or is it just a pchar?
>>
>>It can be either of those. The compiler is free to choose what it
>>does. All you know for sure is that when you try to assign something
>>to "input", the compiler will throw an error.
>>
>>x
>>Jonas
>>
>>
>>------------------------------
>>
>>Message: 3
>>Date: Sat, 31 Dec 2005 19:33:45 +0000
>>From: Tony Pelton <[hidden email]>
>>Subject: [fpc-pascal] XML DOM stuff
>>To: FPC-Pascal users discussions <[hidden email]>
>>Message-ID:
>><[hidden email]>
>>Content-Type: text/plain; charset=ISO-8859-1
>>
>>hi all,
>>
>>i've been toiling over the DOM implementation with the FCL for a few hours
>
> now.
>
>>i had successfully used the XMLRead code to load a DOM from an XML file.
>>
>>i had successfully mutated said document and used XMLWrite to persist
>>those changes to the DOM.
>>
>>i've now been beating my head against the wall trying to figure out
>>how to build a DOM "from scratch" in code.
>>
>>My trouble begins because it would seem that i don't get a "well
>>formed" document by doing a straight "Create()" of an TXMLDocument.
>>
>>i've been digging around inside of the XMLRead code for a bit, trying
>>to understand what _it_ does to get a document going from an XML
>>source file.
>>
>>it's confusing to me.
>>
>>i see some casting and subclassing inside of the XMLRead code that
>>seems to allow for the creation of a well formed TXMLDocument, but i
>>don't see anything that leads me to a well formed API or "factory" for
>>being able to instantiate an "empty" but well formed XML document
>>myself.
>>
>>minimally, i'm having problems because i can't see how to get a
>>DocumentElement attached to the DOM instance via a user serviceable
>>API call.
>>
>>so i can't attach any new elements to the document after a Create().
>>
>>what am i missing ?
>>
>>tia,
>>Tony
>>
>>------------------------------
>>
>>_______________________________________________
>>fpc-pascal maillist  -  [hidden email]
>>http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>>End of fpc-pascal Digest, Vol 17, Issue 1
>>*****************************************
>>
>>
>>__________ Informacia od NOD32 1.1347 (20051230) __________
>>
>>Tato sprava bola preverena antivirusovym systemom NOD32.
>>http://www.eset.sk
>>
>>
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Executable size question

L505
In reply to this post by pianoman-3


> Helo everyone, I would like to ask why are exes generated by FPC so big?
> Simple writeln('Hi'); has about 28 KB. Old FPC 1.0.0 for example  created
> for the same code only 14 kb exe.
> What Should I do to reduce the file size (without compression)
> Pianoman

You can work on a custom System unit to get the size down - I was thinking of doing
this for CGI applications to help uploading speeds, but I'm not sure yet whether it
is worth the efforts. My first priority is to take all the functions out of Sysutils
which don't rely on finalization, because sysutils hauls in 60K, and is a bigger
priority for size. Uploading a 60K CGI program is annoying for modem/lite speed Cable
users. Project is called CompactUtils and not completed yet.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal