Optimization ???

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu Feb 20 20:42:22 PST 2014


On Thursday, 20 February 2014 at 23:31:36 UTC, Mattdef wrote:
> Hi
>
> Why this code is 2 times longer in D then C# ?

Running rdmd -profile test.d it seems that to!() is eating most 
of the time. Removing this brings it down from 530ms to 154ms

   Num          Tree        Func        Per
   Calls        Time        Time        Call
1000000   229304911   229079249         229     immutable(char)[] 
std.conv.toImpl!(immutable(char)[], uint).toImpl(uint, uint, 
std.ascii.LetterCase).toStringRadixConvert!(12uL, 
10).toStringRadixConvert(uint)
1000000   263228452    33923541          33     pure @trusted 
immutable(char)[] std.conv.toImpl!(immutable(char)[], 
uint).toImpl(uint, uint, std.ascii.LetterCase)
1000000   295084102    31855649          31     pure @safe 
immutable(char)[] std.conv.toImpl!(immutable(char)[], 
uint).toImpl(uint)
1000000   322073672    26989570          26     pure @safe 
immutable(char)[] 
std.conv.to!(immutable(char)[]).to!(uint).to(uint)


More information about the Digitalmars-d-learn mailing list