Transpose matrix by chunks

This makes the operation memory efficient without too much slowdown
Profiling operations performance