Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[3.14] GH-139951: Fix major GC performance regression (GH-140262)#140423

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedOct 21, 2025
edited by bedevere-appbot
Loading

  • Count number of actually tracked objects, instead of trackable objects. This ensures that untracking tuples has the desired effect of reducing GC overhead

  • Do not track most untrackable tuples during creation. This prevents large numbers of small tuples causing execessive GCs.
    (cherry picked from commit0c01090)

Co-authored-by: Mark Shannonmark@hotpy.org

* Count number of actually tracked objects, instead of trackable objects. This ensures that untracking tuples has the desired effect of reducing GC overhead* Do not track most untrackable tuples during creation. This prevents large numbers of small tuples causing execessive GCs.(cherry picked from commit0c01090)Co-authored-by: Mark Shannon <mark@hotpy.org>
@sergey-miryanov
Copy link
Contributor

sergey-miryanov commentedOct 21, 2025
edited by hugovk
Loading

The following change fixes free-threading tests (mainly-1386,10 +1385,6 fixes tests, other is a cleanup):

diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.pyindex db643330894..d7a4c066437 100644--- a/Lib/test/test_gc.py+++ b/Lib/test/test_gc.py@@ -3,8 +3,7 @@ from test import support from test.support import (verbose, refcount_test,                           cpython_only, requires_subprocess,-                          requires_gil_enabled,-                          Py_GIL_DISABLED)+                          requires_gil_enabled) from test.support.import_helper import import_module from test.support.os_helper import temp_dir, TESTFN, unlink from test.support.script_helper import assert_python_ok, make_script, run_test_script@@ -1386,10 +1385,6 @@ def callback(ignored):         junk = []         i = 0         detector = GC_Detector()-        if Py_GIL_DISABLED:-            # The free-threaded build doesn't have multiple generations, so-            # just trigger a GC manually.-            gc.collect()         assert not detector.gc_happened         while not detector.gc_happened:             i += 1@@ -1459,10 +1454,6 @@ def __del__(self):         detector = GC_Detector()         junk = []         i = 0-        if Py_GIL_DISABLED:-            # The free-threaded build doesn't have multiple generations, so-            # just trigger a GC manually.-            gc.collect()         while not detector.gc_happened:             i += 1             if i > 50000:

Is it fine if I add such commit to this PR? Should we apply this change to themain?

@efimov-mikhail
Copy link
Member

Сс@colesbury

@colesbury
Copy link
Contributor

The test has a@unittest.skipIf(Py_GIL_DISABLED, "requires GC generations or increments") on main, it should have the same on 3.14

@markshannon
Copy link
Member

Closing in favor of#140447

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@miss-islington@sergey-miryanov@efimov-mikhail@colesbury@markshannon

[8]ページ先頭

©2009-2025 Movatter.jp