{
  "id": 19579269,
  "title": "66x faster on sorted data: Timsort, 24 years on",
  "url": "https://urgent.news/2026/11/12/66x-faster-on-sorted-data-timsort-24-years-on",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-12T00:54:53.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/frankchu/66x-faster-on-sorted-data-timsort-24-years-on-437e"
  },
  "original_language": "en",
  "account": "Tim Peters, a key contributor to Python, passed away on July 15, 2026, at the age of 74. Guido van Rossum, Python's creator, announced the news on November 11, 2026, in the Python discussion forum. Timsort, a sorting algorithm created by Peters in 2002, continues to perform exceptionally well on sorted data, according to recent tests.\n\nTimsort, which was designed for Python lists, remains the default sorting algorithm for many mainstream languages, including Java, Android, Swift, Rust, and Go's slices package. This is due to its efficiency in handling sorted data, which is much faster than random data. For instance, sorting a million already-ordered integers takes only 5.6 milliseconds, while sorting a million shuffled integers takes 369.4 milliseconds.\n\nPeters recognized that the textbook sorting algorithm, n log n, is not always the most efficient solution in real-world scenarios. Many datasets are close to being sorted, with only a few elements out of place. Timsort addresses this by detecting sorted runs and merging them, rather than starting from scratch. The result is that sorted input is 66 times faster than random input, while reversed input takes only 8.0 milliseconds, compared to 369.4 milliseconds for random input.\n\nTo demonstrate Timsort's efficiency, Peters created a class that counted comparisons during sorting. He found that sorting a million integers using Timsort required only 99,999 comparisons, which is the theoretical minimum. In contrast, random input required 1,529,183 comparisons, close to the n log2 n bound. This highlights the adaptivity of Timsort, which optimizes its performance based on the data's characteristics.\n\nPeters' work on Timsort exemplifies the principle of practicality over purity. He focused on improving Python's performance for common cases, rather than adhering strictly to theoretical best practices. His contributions to Python, including the optimized pymalloc, dict implementation, and cyclic garbage collector, have had a lasting impact on the language. Timsort, in particular, continues to provide a significant performance advantage for sorting operations in Python programs.",
  "summary": "66x faster on sorted data: Timsort, 24 years on Tim Peters died on July 15, 2026. Guido van Rossum announced it today, November 11, on the Python discussion forum. The sort Peters wrote in 2002 still sorts a million already-ordered integers in 5.6 milliseconds — 66 times faster than the same million shuffled. I re-ran it this afternoon to check the number holds up, and it does. What happened…",
  "key_points": [
    "Tim Peters, Python contributor, died at 74 on July 15, 2026",
    "Timsort algorithm, created in 2002, excels on sorted data",
    "66x faster than random data, 8x faster than reversed data"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}