Port a benchmark to D?
bearophile
bearophileHUGS at lycos.com
Fri Jun 3 19:55:48 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
More information about the Digitalmars-d
mailing list