Port a benchmark to D?

Iain Buclaw ibuclaw at ubuntu.com
Sat Jun 4 01:32:57 PDT 2011


On 4 June 2011 08:03, Caligo <iteronvexor at gmail.com> wrote:
> On Fri, Jun 3, 2011 at 11:16 PM, dsimcha <dsimcha at yahoo.com> wrote:
>> On 6/4/2011 12:01 AM, Caligo wrote:
>>>
>>> Gentoo/Linux [gcc version 4.4.5, DMD 2.52, latest GDC with GCC 4.4.5,
>>> and latest LDC2]
>>>
>>> g++ -O3
>>> [VIRT: 185MB,  RES: 174MB]
>>> real    0m28.407s
>>> user    0m28.330s
>>> sys     0m0.070s
>>>
>>> DMD -O -release
>>> [VIRT: 94MB,  RES: 92MB]
>>> real    0m43.232s
>>> user    0m42.980s
>>> sys     0m0.070s
>>>
>>> GDC -O3
>>> [VIRT: 306MB,  RES: 295MB]
>>> real    1m10.788s
>>> user    1m10.570s
>>> sys     0m0.190s
>>>
>>> LDC2
>>> segmentation fault
>>
>> Why not -inline on dmd?
>>
>
> I don't like the '-inline' option, but here it is.  Besides, I usually
> use GDC or LDC2 and I was expecting them to outperform DMD because
> they usually do, but not in this case.
>

Well, I'm not the least bit surprised by DMD outperforming GDC here.
Mostly because the program produced by GDC will have 109+ extra array
bounds checks, and 300+ extra assertions (hint: the program produced
by DMD will have 0).


-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list