dimensionSize should call dimensionDomain.length not dimensionDomain.size

To avoid auto(un)boxing. Calling length on a Scala SeqLike is a primitive array operation, but calling size is not.