The State of LDC on Windows
bearophile
bearophileHUGS at lycos.com
Wed Jun 5 18:47:58 PDT 2013
David Nadlinger:
> Alpha-quality binary packages are available as part of 0.11.0
> Beta 3:
> http://forum.dlang.org/post/mailman.871.1370475122.13711.digitalmars-d-ldc@puremagic.com
I have done few small tests:
With no optimization dmd compiles about twice faster (or more)
than ldc2.
When I want optimizations with this ldc I have used "-release
-profile-verifier-noassert -O5". Is this good enough?
I don't know why ldc2 doesn't have "-noboundscheck".
- - - - - - - - - - - -
Regarding run time performance of the D code, if Walter is
interested I have seen this code is about 6 times faster compiled
with ldc2 compared to dmd:
import core.stdc.stdio, std.random, std.conv;
void main(in string[] args) {
immutable uint N = (args.length == 2) ? args[1].to!uint :
1_000;
auto rng = Xorshift(0);
uint total = 0;
for (uint i = 0; i < N; i++)
total += uniform(0, 10, rng);
printf("%u\n", total);
}
If I replace this line:
total += uniform(0, 10, rng);
with:
total += rng.front; rng.popFront;
Then the code compiled with ldc2 is only about 30% faster or so.
Bye,
bearophile
More information about the Digitalmars-d
mailing list