Currently the sorting of the multi-dimensional matrix profile calculation accounts for almost all of the allocations and slowness of the algorithm.