D has now surpassed C++ in overall performance

Deewiant deewiant.doesnotlike.spam at gmail.com
Fri Feb 2 08:56:30 PST 2007


Knud Soerensen wrote:
> I remember a while back I notice that there is a speed difference 
> between using x<y ? a:b; and using if (x<y) a; else b; 
> maybe they are not optimized the same way ???
> 
> Knud

I tested both, and it seemed that the ternary operator (?:) was a bit slower
than the if/else. I just ran the recursive benchmark a few times, and using the
ternary operator resulted in about 0.3 seconds slower run times (about 5.0
seconds versus about 5.3 seconds).

-- 
Remove ".doesnotlike.spam" from the mail address.



More information about the Digitalmars-d-announce mailing list