GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-141890: Fix GC double-counting of marked objects by brandtbucher · Pull Request #141891 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Nov 24, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This move happens twice: once here, and once in gc_collect_increment (the caller).

  • Issue: Incremental GC double-counts work done during the marking phase #141890

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
brandtbucher added 2 commits November 23, 2025 19:42
@brandtbucher
Fix double-counting of marked objects
ea72aae
@brandtbucher
blurb add
727f9a5
@brandtbucher brandtbucher self-assigned this Nov 24, 2025
@brandtbucher brandtbucher added the needs backport to 3.14 bugs and security fixes label Nov 24, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 24, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Nov 24, 2025
Incremental GC double-counts work done during the marking phase #141890
Closed
@brandtbucher
brandtbucher requested a review from markshannon November 24, 2025 03:48
@sergey-miryanov

sergey-miryanov commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

JFYI, #127519

With marking added to the cyclic GC (#127110) we spend a lot of the time in the GC forming transitive closures, both for marking and for the increments of the incremental GC.

Unfortunately the current algorithm has a couple of mistakes in it. One harmful, one beneficial.

The beneficial one is counting the initial mark twice. This helps because it reduces the cost of GC on heaps with little or no garbage
The harmful one is allowing the amount of work done to grow in proportion to the heap size.

Unfortunately, #127519 was reverted.

I had planned to try to fix it, but it's still on my to-do list.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Ansuel Ansuel mentioned this pull request Nov 24, 2025
test_hashlib fails with SSLlibrary having only SHA3 algo but no SHAKE #141907
Closed
@brandtbucher

brandtbucher commented Nov 26, 2025

Copy link
Copy Markdown
Member Author

Ah, interesting. Let's benchmark this change. If the current version is better, we can just multiply by two to be explicit instead of the current code (which looks like a mistake, because originally it was). :)

efimov-mikhail reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 2, 2026
@sergey-miryanov

sergey-miryanov commented May 3, 2026

Copy link
Copy Markdown
Contributor

The generational GC has landed, so this can be closed. Would you like me to close this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 16, 2026
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 bugs and security fixes label May 30, 2026
@brandtbucher brandtbucher closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon Awaiting requested review from markshannon

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@brandtbucher brandtbucher

Labels

awaiting core review needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@brandtbucher @sergey-miryanov @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.