Stanislav Blinov:

Looks like both dmd and ldc don't optimize slice operations yet, had to revert to loops

It's a very silly problem for a statically typed language. The D type system knows the static length of those arrays, but it doesn't use such information. (Similarly several algorithms in Phobos force to throw away this very precious compile-time information requiring dynamic arrays in input.)

I have just suggested a fix for ldc2:
http://forum.dlang.org/thread/qeytzeqnygxpocywy...@forum.dlang.org

I have a similar enhancement request since some time in Bugzilla:
https://d.puremagic.com/issues/show_bug.cgi?id=10523
https://d.puremagic.com/issues/show_bug.cgi?id=10305

Bye,
bearophile

Reply via email to