DMD 1.038 and 2.022 releases
Ary Borenszweig
ary at esperanto.org.ar
Sat Dec 20 05:13:11 PST 2008
Denis Koroskin escribió:
> On Sat, 20 Dec 2008 15:39:08 +0300, Bill Baxter <wbaxter at gmail.com> wrote:
>
>> On Sat, Dec 20, 2008 at 9:11 PM, Denis Koroskin <2korden at gmail.com>
>> wrote:
>>> On Mon, 15 Dec 2008 10:58:23 +0300, Bill Baxter <wbaxter at gmail.com>
>>> wrote:
>>>
>>>> For me, V1.038 compiles my code but takes a really really really long
>>>> time to do so.
>>>>
>>>> It now takes 1 min 20 secs for a full build, when it used to compile
>>>> in 13 seconds.
>>>> Forget the 60% slowdown from LDC -- this is 515% slower!
>>>>
>>>> (building with DSSS and tango)
>>>>
>>>> --bb
>>>>
>>>
>>> I generally make all my imports private and run a command line tool that
>>> strips unnecessary imports once in a while to minimize intermodular
>>> dependencies. Maybe it could help in your case, too?
>>>
>>
>> I'd love to have an unnecessary import finder tool. How does that work?
>>
>> --bb
>
> It's easy: remove an import and try if it still works :)
> I recompile that file only and since all the imports are private, it
> generally doesn't break other files.
>
> The only exception - templates. They aren't fully analyzed until
> instanciated and therefore some imports may be removed even if they are
> necessary. A simple tag prevents an import from removal:
>
> private import std.algorithm; // force
>
> Works about 3 minutes to remove all redundant imports from DWT.
A problem with import removal in D is conditional compilation:
import foo;
import bar;
int lala() {
version(FOO) {
return somethingInModuleFoo();
} else {
return somethingInModuleBar();
}
}
Now you need to compile your file twice, each time with a different
version, and see if any import can be removed (in the example, if you
remove foo, and FOO is not declared as a version, your file still compiles).
More information about the Digitalmars-d-announce
mailing list