Two standard libraries?
Sean Kelly
sean at f4.ca
Sun Jul 15 13:43:51 PDT 2007
Nicolai Waniek wrote:
> Sean Kelly wrote:
>> Nicolai Waniek wrote:
>>
>> At this point, there are two factors that bloat D executables: TypeInfo,
>> and file-level linking. We're likely stuck with the former, but if the
>> latter could be addressed then things would improve tremendously.
>> Unfortunately, this suggests that we'll need a new linker for Win32.
>
> I totally agree with you on these points, for example a minimal "hello world"
> app on my linux box here makes >200kb, that's not what I think of as
> "lightweight application" ;)
For comparison, using printf on Win32/Tango, a "hello world" app is
~100k. Sometime prior to 1.0 the same app was ~70k. And replacing
printf with Stdout results in a ~130k app using the current release.
The 70k-100k jump involves a number of factors, one of which is an
increase of the size of the Tango runtime code (mostly the thread code).
The rest is an increase in the size of TypeInfo, if I remember correctly.
I don't think it would be possible to have "opt-in" TypeInfo generation
because TypeInfo is used for all sorts of things in the runtime: element
comparison for the built-in AAs and array sorting, passing type
information to the GC for scanning purposes, etc. It may be that
TypeInfo size could be reduced somehow, or TypeInfo could always be
generated into some sort of peripheral object file, but I'll admit the
idea that seems most promising is segment-level linking. Since the GNU
linker can already do this (with --gc-sections or some such), perhaps a
good first step would be to get it working there? I know there have
been problems with this option and D exception handling code in the
past, but I recall there being a suggested fix in the bug tracker somewhere.
Sean
More information about the Digitalmars-d
mailing list