Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.13] GH-124567: Revert the Incremental GC in 3.13 #124770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Incorporate AA Turner's doc update
  • Loading branch information
Yhg1s committed Sep 30, 2024
commit 6947c05c11435b0d94087ed5df0f65549b9f1a95
2 changes: 1 addition & 1 deletion 2 Doc/library/gc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The :mod:`gc` module provides the following functions:

With no arguments, run a full collection. The optional argument *generation*
may be an integer specifying which generation to collect (from 0 to 2). A
:exc:`ValueError` is raised if the generation number is invalid. The sum of
:exc:`ValueError` is raised if the generation number is invalid. The sum of
collected objects and uncollectable objects is returned.

The free lists maintained for a number of built-in types are cleared
Expand Down
53 changes: 0 additions & 53 deletions 53 Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,17 +501,6 @@ are not tier 3 supported platforms, but will have best-effort support.
.. seealso:: :pep:`730`, :pep:`738`


.. _whatsnew313-incremental-gc:

Incremental garbage collection
------------------------------

The cycle garbage collector is now incremental.
This means that maximum pause times are reduced
by an order of magnitude or more for larger heaps.
(Contributed by Mark Shannon in :gh:`108362`.)


Other Language Changes
======================

Expand Down Expand Up @@ -908,36 +897,6 @@ fractions
(Contributed by Mark Dickinson in :gh:`111320`.)


gc
--

The cyclic garbage collector is now incremental,
which changes the meaning of the results of
:meth:`~gc.get_threshold` and :meth:`~gc.set_threshold`
as well as :meth:`~gc.get_count` and :meth:`~gc.get_stats`.

* For backwards compatibility, :meth:`~gc.get_threshold` continues to return
a three-item tuple.
The first value is the threshold for young collections, as before;
the second value determines the rate at which the old collection is scanned
(the default is 10, and higher values mean that the old collection
is scanned more slowly).
The third value is meaningless and is always zero.

* :meth:`~gc.set_threshold` ignores any items after the second.

* :meth:`~gc.get_count` and :meth:`~gc.get_stats` continue to return
the same format of results.
The only difference is that instead of the results referring to
the young, aging and old generations,
the results refer to the young generation
and the aging and collecting spaces of the old generation.

In summary, code that attempted to manipulate the behavior of the cycle GC
may not work exactly as intended, but it is very unlikely to be harmful.
All other code will work just fine.


glob
----

Expand Down Expand Up @@ -1502,11 +1461,6 @@ zipimport
Optimizations
=============

* The new :ref:`incremental garbage collector <whatsnew313-incremental-gc>`
means that maximum pause times are reduced
by an order of magnitude or more for larger heaps.
(Contributed by Mark Shannon in :gh:`108362`.)

* Several standard library modules have had
their import times significantly improved.
For example, the import time of the :mod:`typing` module
Expand Down Expand Up @@ -2619,13 +2573,6 @@ Changes in the Python API
Wrap it in :func:`staticmethod` if you want to preserve the old behavior.
(Contributed by Serhiy Storchaka in :gh:`121027`.)

* The :ref:`garbage collector is now incremental <whatsnew313-incremental-gc>`,
which means that the behavior of :func:`gc.collect` changes slightly:

* ``gc.collect(1)``: Performs an increment of garbage collection,
rather than collecting generation 1.
* Other calls to :func:`!gc.collect` are unchanged.

* An :exc:`OSError` is now raised by :func:`getpass.getuser`
for any failure to retrieve a username,
instead of :exc:`ImportError` on non-Unix platforms
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.