Port a benchmark to D?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat Jun 4 12:31:18 PDT 2011
On 06/04/2011 11:08 AM, Timon Gehr wrote:
>> Andrei:
>>
>>> Far as I can tell D comes in the second place after C++ at run time.
>>> With optimizations and all it could get significantly closer.
>>
>> First version, with just classes, a bit better cleaned up:
>> http://codepad.org/DggCx26d
>>
>> Second version, with all structs:
>> http://codepad.org/etsLsZV5
>>
>> Tomorrow I'll de-optimize it a bit replacing some structs with classes. And>
> then I'll create one or two more optimized versions (one using a memory pool for
> the nodes, and one trying to apply some of the C++ improvement ideas> from the
> original paper).
>>
>> The number of instances allocated:
>> Class instances:
>> SimpleLoop_counter 3_936_102
>> LoopStructureGraph_counter 15_051
>> UnionFindNode_counter 13_017_663
>> HavlakLoopFinder_counter 15_051
>> BasicBlockEdge_counter 378_036
>> BasicBlock_counter 252_013
>> MaoCFG_counter 1
>>
>> UnionFindNode probably will give some gain if allocated from a pool.
>>
>> Later,
>> bearophile
>
> Your port segfaults DMD 2.053 with the -g flag (at least on linux).
> @Andrei: You may want to point out on reddit that the code is approx. a 1 to 1
> port of the C++ code and not specially tuned.
>
> Timon
Better yet, feel free to contribute. The more of us participate, the better.
Andrei
More information about the Digitalmars-d
mailing list