Flame bait: D vs. Rust vs. Go Benchmarking

dennis luehring dl.soluz at gmx.net
Wed Jul 24 00:39:13 PDT 2013


Am 24.07.2013 09:20, schrieb Peter Alexander:
> 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.
>

that was my second thought - what is benchmarked more
the std library or the code-generation itself

for an pure code-generation test he should implement the stdc random
in pure D, go, Haskell whatever and get rid of the printf stuff - that 
would give better results

or he should try to use different random implementations, (but still get 
rid of the io stuff)


More information about the Digitalmars-d mailing list