# Allocation / performance for 2d array sorts

**URL:** <https://discourse.julialang.org/t/allocation-performance-for-2d-array-sorts/49910>\
**Category:** Performance\
**Created:** [November 10, 2020, 12:51pm UTC](https://discourse.julialang.org/t/allocation-performance-for-2d-array-sorts/49910 "2020-11-10T12:51:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [November 10, 2020, 3:08pm UTC](https://discourse.julialang.org/t/allocation-performance-for-2d-array-sorts/49910/4 "2020-11-10T15:08:41Z")

</div>

I did not deeply examine the code samples, but it may be related to the problems I have gone through to re-implement an heuristic which was mostly made of applying `sortperm!`. I had to gut `sort!` and implement a hacky `_swap_permute!` to get the best performance. This has come up recently in [this Discourse thread](https://discourse.julialang.org/t/fastest-way-to-permute-array-given-some-permutation/49687/6), in which I link to my repository and the aforementioned code.

---

_[View the full topic](https://discourse.julialang.org/t/allocation-performance-for-2d-array-sorts/49910)._
