Improving performance when sorting array of structs by multiple fields
If your analysis is correct and the slowdown is really cased by the copying, then you could avoid that by using Array.Sort(), which directly sorts the array you have.

Though Array.Sort() isn't as convenient as OrderBy() combined with ThenBy(), you will have to create an IComparer or Comparison for each of the possible sort orders. It could look something like this:

Comparison&lt;eCubeType&gt; yFirstComparison = (c1, c2) =&gt;
{
    int result = c1.Y.CompareTo(c2.Y);
    if (result != 0)
        return result;

    // ...

    return c1.Z.CompareTo(c2.Z);
}


If you don't like to do this manually you can use NList (the project site seems to be down at the moment):

IComparer&lt;eCubeType&gt; yFirstComparer = KeyComparer&lt;eCubeType&gt;.OrderBy(c =&gt; c.Y)
    .ThenBy(c =&gt; c.CubeType).ThenBy(c =&gt; c.LightLevel).ThenBy(c =&gt; c.X).ThenBy(c =&gt; c.Z);