Port a benchmark to D?

Timon Gehr timon.gehr at gmx.ch
Sat Jun 4 09:08:00 PDT 2011


> 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


More information about the Digitalmars-d mailing list