Slow performance compared to C++, ideas?

finalpatch fengli at gmail.com
Thu May 30 18:57:08 PDT 2013


Hi bearophile,

Thanks for the reply. I changed it to 0..height and it has no 
measurable effect to the runtime.

The reason I used iota(height) was to test 
std.parallelism.parallel. On Windows if I do foreach (y; 
parallel(iota(height))) I do get almost 4x speed up on a quadcore 
computer. However, on OSX, parallel() either does nothing (LDC) 
or makes it slower than single threaded(DMD).

On Friday, 31 May 2013 at 01:42:53 UTC, bearophile wrote:
> Don't do this:
> foreach (y; (iota(height)))
>
> Use this, because those abstractions are not for free:
> foreach (y;  0 .. height)


More information about the Digitalmars-d mailing list