Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you care a lot about executable size, then you might want to avoid using STL in your program.</p> <p>For example, <a href="http://www.utorrent.com/" rel="nofollow">uTorrent</a> doesn't use STL and that is one reason why it's so small.</p> <p>Since STL does rely on templates a lot (it is Standard TEMPLATE Library, after all), many times you use templates, the compiler has to generate extra code for every type you use when dealing with STL.</p> <p>This is compile time polymorphism and will increase your executable size the more you use it.</p> <p>If you exclude STL from your project (and use templates sparingly or not at all), your code size will get smaller. Note that it won't necessarily be faster.</p> <p>Also note that I'm not talking about a program's memory usage during execution, since that will depend on how many objects your allocating during your app's lifetime.</p> <p>I'm talking about your binary's executable. </p> <p>If you want an example, note that a simple Hello world program, when compiled, might be bigger than a cleverly code <a href="http://en.wikipedia.org/wiki/Demo_%28computer_programming%29" rel="nofollow">demo</a> which can include an entire 3D engine (run time generated) in a very small executable.</p> <hr> <p>Some info regarding uTorrent's size:</p> <p><a href="http://web.archive.org/web/20080619055556/http://www.utorrent.com/faq.php#How_can_.C2.B5Torrent_be_so_small_and_so_fast.3F" rel="nofollow">Official FAQ (from 2008), this question doesn't appear in recent FAQ.</a></p> <p><a href="http://forum.utorrent.com/viewtopic.php?id=55611" rel="nofollow">How was uTorrent programmed to be so efficient?</a></p> <p><a href="http://forum.staging.utorrent.com/viewtopic.php?id=1632" rel="nofollow">Second post regarding this.</a></p> <p><a href="https://forum.utorrent.com/viewtopic.php?id=22219" rel="nofollow">Third post regarding this.</a></p> <p>Note that, even though uTorrent is >300kb and is compressed with <a href="http://upx.sourceforge.net/" rel="nofollow">UPX</a>, it is still really small when you take into account what it's capable of doing.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload