# Interesting talk for the Julia sorting community

**URL:** <https://discourse.julialang.org/t/interesting-talk-for-the-julia-sorting-community/129385>\
**Category:** Offtopic\
**Tags:** sort, sorting\
**Created:** [May 27, 2025, 3:01pm UTC](https://discourse.julialang.org/t/interesting-talk-for-the-julia-sorting-community/129385 "2025-05-27T15:01:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)\
**Post date:** [May 27, 2025, 3:01pm UTC](https://discourse.julialang.org/t/interesting-talk-for-the-julia-sorting-community/129385/1 "2025-05-27T15:01:56Z")

</div>

Here is an interesting talk given lately:

[![](https://global.discourse-cdn.com/julialang/original/3X/b/f/bf77eefd2b3b5481cfe6c71b9fab9ccaca22cbc0.jpeg "Practical Adaptive Sorting and Searching") ](https://www.youtube.com/watch?v=gtxqfKCx4t0)

Giving details about TimSort and the new PowerSort and other interesting details.

This may be for @Lilith and other people who like things to be in proper order. Perhaps Julia can implement PowerSort (does it already?)

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [May 27, 2025, 3:15pm UTC](https://discourse.julialang.org/t/interesting-talk-for-the-julia-sorting-community/129385/2 "2025-05-27T15:15:40Z")

</div>

It is a nice improvement over timsort, but in general, Python and Julia have different sorting algorithms that will be faster. Python Lists are like Julia `Vector{Any}` which means the cost of swaps in Python is much cheaper than comparisons, while for most lists in Julia, the costs are reversed.

---

<div class="post-metadata">

**Author:** ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)\
**Post date:** [May 27, 2025, 6:58pm UTC](https://discourse.julialang.org/t/interesting-talk-for-the-julia-sorting-community/129385/3 "2025-05-27T18:58:37Z")

</div>

Perhaps the lesson to learn, is from Java, which has a different algorithm for primitive `Vector{Int}`-like vectors and `Vector{big-struct}` vectors. The relevant slide in the talk is:

 ![dual-v-tim](https://global.discourse-cdn.com/julialang/original/3X/7/8/78fb9647301e0a1f1feaecd0c9689a3c56da64a5.jpeg)

It would be very Julian to have sort algorithm adapt to struct size, or some comparison cost hint.

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [May 27, 2025, 8:01pm UTC](https://discourse.julialang.org/t/interesting-talk-for-the-julia-sorting-community/129385/4 "2025-05-27T20:01:07Z")

</div>

> [@Dan](#):
>
> It would be very Julian to have sort algorithm adapt to struct size, or some comparison cost hint.

AFAIU Julia already has a bunch of different sorting algorithms and chooses among them based on the element type, among other things.
