Skip to content

Clarify that performance improvements are not backported#1826

Open
gaborbernat wants to merge 3 commits into
python:mainfrom
gaborbernat:perf-no-backport
Open

Clarify that performance improvements are not backported#1826
gaborbernat wants to merge 3 commits into
python:mainfrom
gaborbernat:perf-no-backport

Conversation

@gaborbernat
Copy link
Copy Markdown

A contributor recently proposed backporting a performance improvement to the maintenance branches, and the question surfaced that the devguide does not say whether optimizations should be backported. Core developers confirmed the long-standing practice in the linked discussion: optimizations are not backported, because an optimization can introduce a regression and a regression in a bugfix release is costly to track down and undo.

This adds that rule to the maintenance-branch section of the development cycle, next to the existing "bug fixes, test improvements, and documentation" guidance, and spells out the narrow exception a few core developers noted: a change that is a clear win, carries no regression risk (including for code that subclasses or monkey-patches internals), and matters enough to applications to justify it, discussed first.

Discussion: https://discuss.python.org/t/performance-improvements-and-backports/107625

A contributor proposed backporting a performance improvement to the
maintenance branches, which prompted core developers to restate the
long-standing practice: optimizations are not backported. An optimization can
introduce a regression, and a regression in a bugfix release is costly to find
and undo.

Add this to the maintenance-branch rules so the expectation is explicit, and
describe the narrow exception (a clear, no-risk, high-impact change agreed in
discussion).

Discussion: https://discuss.python.org/t/performance-improvements-and-backports/107625
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Jun 5, 2026

Documentation build overview

📚 CPython devguide | 🛠️ Build #33002442 | 📁 Comparing 23c0153 against latest (aeb99bd)

  🔍 Preview build  

2 files changed
± versions/index.html
± developer-workflow/development-cycle/index.html

Comment thread developer-workflow/development-cycle.rst Outdated
Sergey noted the maintenance-branch sentence already reads clearly, so a
separate paragraph restates it. Move the performance point into that sentence as
one clause and let the existing "rare exceptions ... must be discussed first"
line cover the narrow case.
@hugovk hugovk changed the title 📝 docs: clarify that performance improvements are not backported Clarify that performance improvements are not backported Jun 5, 2026

The only changes allowed to occur in a maintenance branch without debate are
bug fixes, test improvements, and edits to the documentation.
bug fixes, test improvements, and edits to the documentation. Performance
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really get why "performance improvements" are special here, they are features, and we already explicitly state (albeit elsewhere):

The only branch that receives new features is main, the in-development branch.

In this event, I think everything generally went according to the docs: can't backport features "without debate," however exceptions can be made, provided you open a discussion first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants