Flame bait: D vs. Rust vs. Go Benchmarking

John Colvin john.loughran.colvin at gmail.com
Wed Jul 24 04:27:16 PDT 2013


On Wednesday, 24 July 2013 at 07:20:16 UTC, Peter Alexander wrote:
> This comment is worrying:
>
> "Can you try D version without std.random, and use srand and 
> rand from std.c.stdlib? I think it should be almost same speed 
> as C version ;-)"
>
> "Wow! Just tried that, and this brings the running time of the 
> DMD-compiled version to 0.770s from 1.290, the GDC-compiled 
> version from 1.060 to 0.680s, and the LDC version to 0.580s 
> from 0.710s. Meaning the LDC version is on par with the 
> Clang-compiled C version and just slightly beats the 
> GCC-compiled C one! There really should be a warning note in 
> the std.random library documentation that for 
> performance-critical code the C stdlib random generator is a 
> better choice."
>
>
> Is this just because RNGs are value types? It's literally 
> causing bad press for D, so this needs to be high on the 
> priority list.

The c stdlib random number generation isn't very random.

There should be a note in std.random docs warning that it's 
slower but better than the c stdlib version.


More information about the Digitalmars-d mailing list