Size ratio of source code to executable code

Discussion in 'Software' started by yeeha, Apr 18, 2011.

  1. yeeha

    yeeha Private First Class

    Hello,

    I'm a non-expert writing a paper on a legal topic and I'm looking to fact-check and hopefully provide a reference for a claim I want to make.

    What I am interested in is typical size ratios of source code and resulting object code. The point I am trying to make is that due to the compactness of computer code, it is much easier to transfer valuable intellectual property across networks because, e.g., the product of tons and tons of R&D can fit into the same space as a simple DVD movie.

    My offhand guess is that 1 MB of executable code might involve, say, up to 500,000 lines of source code, not counting comments, depending on what type of software it was, what OS and type of OS it was written for (e.g. Windows vs Linux, 32 vs 64 bit), whether lots of outside libraries were needed..etc..

    But as I said I don't know a lot about this type of stuff and am only hazarding a guess.

    If anyone is able to point me to anything concrete on this subject, ideally something that can be cited as a reference work, I'd appreciate it greatly. Thanks in advance for any comments.
     
  2. mjnc

    mjnc MajorGeek

    Hi yeeha.

    I don't think you will find any typical or general ratio between source code and the final executable.
    I think it will vary a good bit depending on which language and which compiler and linker is used.
    The number of lines isn't the only way to measure the size of the source code,
    as some lines can very short, being only a function call, while other lines can be much longer complex expressions.
    You should also consider the total size of the source code, say in kilobytes.

    Also, object code is not actually executable. It has to be "linked" with the required or requested definitions in one or more library files.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds