Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Code size a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 2360 of 2534
Post > Topic >>

Re: Code size as a function of source size

by Marco van de Voort <marcov@[EMAIL PROTECTED] > Mar 14, 2008 at 10:30 AM

On 2008-03-12, J|rgen Bvhm <jboehm@[EMAIL PROTECTED]
> wrote:
> I would like to pose a very simple question, for which nevertheless I
> could not find an answer through google:
>
>    Of what general type is the dependence of the size of compiled code
> to the size of the respective source code?

Just to give an idea of a possible approximation to get a discussion
started:

code := FactorA * lines + func(lines,total library size) + FactorC.

The first term is the own code you write, roughly lineair with the size of
lines.  The FactorA constant depends on language, style etc.

The last term is the minimal size of the runtime library and other
overhead
(e.g. the header of the binary format, relocations etc)

The second term is the effect that on average large code uses a larger
part
of the optional routines of the libraries.

However this is a function depending on, amongst others, coding style
(e.g.
code that only calculates will use a relative small part of the runtime),
how standalone the average routine in the runtime is, how good the
compiler
is in smartlinking etc. Usually this looks like a log function, but then
asymptotic to the total library size (since eventually everything is
linked
in)

A complicating factor is functionality like templates that can cause (for
some languages) parts of the library to be instantiated multiple times.
But
even then goes that eventually the most used templates will be
instantiated
for the most used types, and the second term gets less dependant on
program
lines.
 




 4 Posts in Topic:
Code size as a function of source size
=?ISO-8859-1?Q?J=FCrgen_B  2008-03-12 20:28:20 
Re: Code size as a function of source size
Marco van de Voort <ma  2008-03-14 10:30:09 
Re: Code size as a function of source size
Barry Kelly <barry.j.k  2008-03-14 14:55:39 
Re: Code size as a function of source size
Sid Touati <SidTouati@  2008-04-22 11:24:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 22:26:48 CDT 2008.