DM linker vs GCC linker?

Andrea Fontana advmail at katamail.com
Wed Jan 18 06:37:08 PST 2012


Ok, here a test:

test.d :

import std.xml;
import std.stdio;
import std.conv;

int main(string[] args)
{
        if (args.length != 2)
        {
                writeln("Usage: ", args[0], " file.xml");
                return 0;
        }

        string content = to!string(std.file.read(args[1]));
        
        try{
                check(content);
        } catch (CheckException ex) { writeln("Exception: ", ex); }
        return 0;
}


dmd -c test.d && gcc test.o -lphobos2 -lrt -lpthread -o testgcc
vs
dmd -c test.d && dmd test.o -oftestd

try this code using a long xml file (tested here with a 2.0 mb list of
italian cities) ...

Il giorno mer, 18/01/2012 alle 15.27 +0100, Andrea Fontana ha scritto:

> I can't understand why it's 22 times slower...
> 
> Il giorno mer, 18/01/2012 alle 14.54 +0100, Trass3r ha scritto: 
> 
> > > Configuration:
> > > Ubuntu 11.10 64bit
> > > DMD64 D Compiler v2.056
> > > gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
> > 
> > ? dmd also uses ld to link.
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120118/f22d5863/attachment.html>


More information about the Digitalmars-d mailing list