René's URL Explorer Experiment


Title: [RFC] Replace rust-timsort so RustPython sorting speed ~= CPython sorting speed · Issue #6093 · RustPython/RustPython · GitHub

Open Graph Title: [RFC] Replace rust-timsort so RustPython sorting speed ~= CPython sorting speed · Issue #6093 · RustPython/RustPython

X Title: [RFC] Replace rust-timsort so RustPython sorting speed ~= CPython sorting speed · Issue #6093 · RustPython/RustPython

Description: WIP/Draft PR Summary Replace the single usage of rust-timsort with a more performant sorting algorithm. Either Rust's default sorting algorithm or a crate like glidesort which has positive benchmarks against the default implementation. D...

Open Graph Description: WIP/Draft PR Summary Replace the single usage of rust-timsort with a more performant sorting algorithm. Either Rust's default sorting algorithm or a crate like glidesort which has positive benchmar...

X Description: WIP/Draft PR Summary Replace the single usage of rust-timsort with a more performant sorting algorithm. Either Rust's default sorting algorithm or a crate like glidesort which has positive benc...

Opengraph URL: https://github.com/RustPython/RustPython/issues/6093

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[RFC] Replace rust-timsort so RustPython sorting speed ~= CPython sorting speed","articleBody":"[WIP/Draft PR](https://github.com/RustPython/RustPython/pull/6096)\n\n## Summary\n\nReplace the [single usage of rust-timsort](https://github.com/RustPython/RustPython/blob/a9a9e3bf118f6c631ef99fe7174215254f846097/vm/src/builtins/list.rs#L525-L528) with a more performant sorting algorithm. Either Rust's default sorting algorithm or a crate like [glidesort](https://crates.io/crates/glidesort) which has positive benchmarks against the default implementation.\n\n## Detailed Explanation\n\nAs of CPython 3.11, [Timsort is no longer the default sorting algorithm](https://www.wild-inter.net/posts/powersort-in-python-3.11). It is instead an algorithm called Powersort.\n\n### rust-timsort\n\nRustPython currently uses a forked project https://github.com/RustPython/rust-timsort as its default sorting algorithm. To quote rust-timsort's README.\n\n> This is still an extreme work-in-progress, and performance has vast room for improvement.\n\nThis performance gap has become noticeable as new unit tests in later Python versions are introduced, which attempt to sort larger and larger lists. Sorting 1 million random numbers with rust-timsort takes 10-20 minutes vs 0.3 seconds for CPython.\n\n```shell\nRustPython on  statistics-module-kde-function [$!?] via :snake: v3.13.1 via :crab: v1.88.0 \n✦ ❯ time python -c \"from random import random; sorted([random() for i in range(1_000_000)]); print('DONE');\"\nDONE\n\nreal    0m0.309s\nuser    0m0.274s\nsys    0m0.036s\n\nRustPython on  statistics-module-kde-function [$!?] via :snake: v3.13.1 via :crab: v1.88.0 \n✦ ❯ time cargo run --release -- -c \"from random import random; sorted([random() for i in range(1_000_000)]); print('DONE');\"\n    Finished `release` profile [optimized] target(s) in 0.16s\n     Running `target/release/rustpython -c 'from random import random; sorted([random() for i in range(1_000_000)]); print('\\''DONE'\\'');'`\nDONE\n\nreal    16m52.217s\nuser    16m51.926s\nsys    0m0.174s\n```\n\n### glidesort\n\n[Glidesort](https://crates.io/crates/glidesort) is a crate which contains a sorting algorithm Glidesort which is an apparent enhancement to Powersort. Unlike rust-timsort, Glidesort has posted benchmark numbers showing it comparing as good or significantly better (in the case of largely presorted lists) than Rust's builtin sorting method which is a Mergesort implementation.\n\n\u003cimg width=\"1325\" height=\"869\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/b34bd341-0aad-4dc2-9d2c-b1aada0e2c05\" />\n\n## Drawbacks, Rationale, and Alternatives\n\n### Rationale\n\nCPython and PyPy both have left Timsort behind as better performing alternatives became available i.e. Powersort. I believe the usage of Timsort in any Python is an implementation detail and if better performing sorting algorithms are available, they should be fair game.\n\nIf we choose to go with the default Rust sort then an entire dependency is removed from RustPython and maintaining the sorting algorithm becomes a non-issue until such time as performance warrants using something different.\n\n### Drawbacks\n\n- A drawback with Glidesort is it does not seem to contain any tests and is not actively maintained. This would probably need forking like rust-timsort\n\n\n## Unresolved Questions\n\n- Is Rust's builtin sorting algorithm quick enough to be happy to drop dependencies on fancier algorithms for easier maintainability?\n- If not, is Glidesort not having tests and needing to be forked a blocker and should some other crates be considered?\n","author":{"url":"https://github.com/jackoconnordev","@type":"Person","name":"jackoconnordev"},"datePublished":"2025-08-13T22:39:22Z","url":"https://github.com/RustPython/RustPython/issues/6093"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:74182f8c-353a-c3fc-e615-e8b78ff8ac3f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idADD2:1F2B:12B65C0:18F2C49:6B01F721
html-safe-nonced6f5450dcd514c9c2bd9c1eec2d076be242c5d08ffa74a293e362caba7c45a96
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREQyOjFGMkI6MTJCNjVDMDoxOEYyQzQ5OjZCMDFGNzIxIiwidmlzaXRvcl9pZCI6IjQ0MDkwMjg4OTg4OTM5ODU1NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9e76f6f530c89efdf42abb86088dce42242ae1b83226ab4cc75aa75a1181910f
hovercard-subject-tagissue:3320091168
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/RustPython/RustPython/6093/issue_layout
twitter:imagehttps://opengraph.githubassets.com/106114e27bc328a2eabb9ac6594743b8c3f68f57148789e692fa6b0f2155e230/RustPython/RustPython/issues/6093
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/106114e27bc328a2eabb9ac6594743b8c3f68f57148789e692fa6b0f2155e230/RustPython/RustPython/issues/6093
og:image:altWIP/Draft PR Summary Replace the single usage of rust-timsort with a more performant sorting algorithm. Either Rust's default sorting algorithm or a crate like glidesort which has positive benchmar...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejackoconnordev
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/RustPython/RustPython/issues/6093#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fissues%2F6093
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fissues%2F6093
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/issues/6093
Reloadhttps://github.com/RustPython/RustPython/issues/6093
Reloadhttps://github.com/RustPython/RustPython/issues/6093
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
https://github.com/RustPython/RustPython
New issuehttps://github.com/login?return_to=https://github.com/RustPython/RustPython/issues/6093
New issuehttps://github.com/login?return_to=https://github.com/RustPython/RustPython/issues/6093
[RFC] Replace rust-timsort so RustPython sorting speed ~= CPython sorting speedhttps://github.com/RustPython/RustPython/issues/6093#top
RFCRequest for commentshttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22RFC%22
https://github.com/jackoconnordev
jackoconnordevhttps://github.com/jackoconnordev
on Aug 13, 2025https://github.com/RustPython/RustPython/issues/6093#issue-3320091168
WIP/Draft PRhttps://github.com/RustPython/RustPython/pull/6096
single usage of rust-timsorthttps://github.com/RustPython/RustPython/blob/a9a9e3bf118f6c631ef99fe7174215254f846097/vm/src/builtins/list.rs#L525-L528
glidesorthttps://crates.io/crates/glidesort
Timsort is no longer the default sorting algorithmhttps://www.wild-inter.net/posts/powersort-in-python-3.11
https://github.com/RustPython/rust-timsorthttps://github.com/RustPython/rust-timsort
Glidesorthttps://crates.io/crates/glidesort
https://private-user-images.githubusercontent.com/134723582/477772571-b34bd341-0aad-4dc2-9d2c-b1aada0e2c05.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyOTEyMTQsIm5iZiI6MTc5NTI5MDkxNCwicGF0aCI6Ii8xMzQ3MjM1ODIvNDc3NzcyNTcxLWIzNGJkMzQxLTBhYWQtNGRjMi05ZDJjLWIxYWFkYTBlMmMwNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYxMTIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MTEyMVQxOTU1MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNjkxYjg3NDEzOGY4ZmQwM2M3NWYwYTBmZTE1MTMxZGY3MTAwZGU5OWMxODU5MjUxNzM1MTI4NmNhNmFkOWUxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.-pJZ6YEMDvX0ccnqimeiHfvlS6OLxUJ9tJRVXgL4IWY
jackoconnordevhttps://github.com/jackoconnordev
RFCRequest for commentshttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22RFC%22
on Aug 13, 2025https://github.com/RustPython/RustPython/issues/6093#event-19146862199
https://github.com/jackoconnordev
jackoconnordevhttps://github.com/jackoconnordev
on Aug 15, 2025https://github.com/RustPython/RustPython/issues/6093#issuecomment-3192380481
#6096https://github.com/RustPython/RustPython/pull/6096
RustPython/vm/src/builtins/list.rshttps://github.com/RustPython/RustPython/blob/8720cd14e530d6ec45f8a40634a7752cb852cca4/vm/src/builtins/list.rs#L520
8720cd1https://github.com/RustPython/RustPython/commit/8720cd14e530d6ec45f8a40634a7752cb852cca4
jackoconnordevhttps://github.com/jackoconnordev
on Aug 15, 2025https://github.com/RustPython/RustPython/issues/6093#event-19180490525
https://github.com/youknowone
youknowonehttps://github.com/youknowone
on Oct 6, 2026https://github.com/RustPython/RustPython/issues/6093#issuecomment-6017771342
youknowonehttps://github.com/youknowone
completedhttps://github.com/RustPython/RustPython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 6, 2026https://github.com/RustPython/RustPython/issues/6093#event-32604465101
Sign up for freehttps://github.com/signup?return_to=https://github.com/RustPython/RustPython/issues/6093
Sign in to commenthttps://github.com/login?return_to=https://github.com/RustPython/RustPython/issues/6093
RFCRequest for commentshttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22RFC%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.