On Friday, 14 February 2014 at 16:00:09 UTC, Robin wrote:
this(size_t rows, size_t cols) {
this.dim = Dimension(rows, cols);
this.data = new T[this.dim.size];
enum nil = to!T(0);
foreach(ref T element; this.data) element = nil;
}
I am no expert at optimizing D code, so this is a bit of a shot
in the dark, but does your speed improve at all if you replace:
this.data = new T[this.dim.size];
with: this.data.length = this.dim.size
