# Sort allocates twice more memory

**URL:** <https://discourse.julialang.org/t/sort-allocates-twice-more-memory/90756>\
**Category:** Performance\
**Created:** [November 24, 2022, 3:44pm UTC](https://discourse.julialang.org/t/sort-allocates-twice-more-memory/90756 "2022-11-24T15:44:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [November 24, 2022, 3:44pm UTC](https://discourse.julialang.org/t/sort-allocates-twice-more-memory/90756/1 "2022-11-24T15:44:25Z")

</div>

Hi,  
It seems the sort function allocates twice more memory in master vs 1.8.3:

```julia
using BenchmarkTools
x = rand(10^8);
@btime sort($x);

```

In 1.8.3 I get 2 allocations 762 MiB vs 6 allocations 1.49GiB in master.  
Is that considered a regression and will be addressed?  
I see that the time spent is improving from 10.2s to 6.2s.  
Thank you

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [November 25, 2022, 3:25pm UTC](https://discourse.julialang.org/t/sort-allocates-twice-more-memory/90756/2 "2022-11-25T15:25:38Z")

</div>

Should I maybe open an issue on github?
