Compiler: Size of generated executable file

Chris invalid at invalid.invalid
Tue Jan 12 11:47:06 PST 2010


"bearophile"
> Chris:
>> Execution speed perhaps, since the time elapsed is proportional to the
>> number of processor instruction executed. This explains why some people
>> (for certain time critical apps) do not even take the step from C to C++,
>> and chose to stay 20 year behind "modern" languages.
>
> In real programs what takes time are (beside I/O and cache issues that are
> another form of I/O) often small amounts of code, usually loops inside
> loops. Removing a single instruction inside them can reduce the running
> time by K%, while removing a megabyte of code elsewhere may just
> reduce a little the loading time, etc.

I am aware of it, this is why I specified instruction _executed_.

A loop that executes 1000 times take roughly the same running
time of the equivalent loop content written 1000 times (but the
looping version has more chance to fit in CPU cache...).

This does inflate the .exe but will not change the total execution
time, and is not the point I was trying to make.
I was not talking about reducing disk usage or .exe size per se, but
regarding speed improvement (the real goal).

If Mr.Bright will confirm that the important section of code are well
optimized, and the size problem was only due to some peripheral branch
of code seldom executed, my concern will be mostly resolved.
Thanks. 





More information about the Digitalmars-d mailing list