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-116946: remove unnecessary gc from _decimal types by skirpichev · Pull Request #156034 · python/cpython

Conversation

@skirpichev

@skirpichev skirpichev commented Aug 19, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

On my laptop (gcc 14.2, default configure flags) for pyperformance benchmarks (decimal_* should be enabled first, see python/pyperformance#473):

decimal_factorial: Mean +- std dev: [ref] 1.05 sec +- 0.02 sec -> [patch] 918 ms +- 6 ms: 1.14x faster
decimal_pi: Mean +- std dev: [ref] 1.99 sec +- 0.02 sec -> [patch] 1.76 sec +- 0.02 sec: 1.13x faster
telco: Mean +- std dev: [ref] 78.7 ms +- 0.5 ms -> [patch] 73.5 ms +- 0.4 ms: 1.07x faster

Geometric mean: 1.11x faster

Micro-benchmark (same as in #158207):

Decimal(0): Mean +- std dev: [ref] 545 ns +- 19 ns -> [patch] 451 ns +- 30 ns: 1.21x faster
Decimal(123): Mean +- std dev: [ref] 550 ns +- 32 ns -> [patch] 450 ns +- 9 ns: 1.22x faster
Decimal('123'): Mean +- std dev: [ref] 721 ns +- 19 ns -> [patch] 624 ns +- 31 ns: 1.16x faster

Geometric mean: 1.19x faster
  • Issue: Heap types implemented in C must have Py_TPFLAGS_HAVE_GC and implement tp_traverse #116946

Sorry, something went wrong.

Uh oh!

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

All reactions
@skirpichev
pythongh-116946: remove unnecessary gc from _decimal types
e5ec0b3
@bedevere-app bedevere-app Bot mentioned this pull request Aug 19, 2026
Heap types implemented in C must have Py_TPFLAGS_HAVE_GC and implement tp_traverse #116946
Open
@bedevere-app bedevere-app Bot added the awaiting review label Aug 19, 2026
@skirpichev

skirpichev commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

This partially fix speed regression, noticed in #144650.

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev

skirpichev commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

@serhiy-storchaka, does it make sense for you?

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev

skirpichev commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

CC @vstinner

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev skirpichev mentioned this pull request Oct 23, 2026
gh-144650: support Vectorcall for _decimal.Decimal's #158207
Merged
@skirpichev skirpichev closed this Nov 2, 2026
@skirpichev
skirpichev deleted the decimal-nogc/116946 branch November 2, 2026 02:42
@vstinner

vstinner commented Nov 2, 2026

Copy link
Copy Markdown
Member

I was away for 2 weeks. The benchmark results seem to be enough to justify this change. IMO the change is worth it.

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev
skirpichev restored the decimal-nogc/116946 branch November 2, 2026 11:46
@skirpichev skirpichev reopened this Nov 2, 2026
@skirpichev

skirpichev commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

I was away for 2 weeks. The benchmark results seem to be enough to justify this change. IMO the change is worth it.

I closed most of my prs. When issues kept open - I don't see a big difference: anyone who interested in the change could reopen pr or ask for it, when CPython team will have enough bandwidth for review.

For the given pr, my concern is here: #116946 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev
Merge branch 'main' into decimal-nogc/116946
8a5beaa
@skirpichev
skirpichev requested a review from vstinner November 5, 2026 23:12
@vstinner

vstinner commented Nov 6, 2026

Copy link
Copy Markdown
Member

For the given pr, my concern is here: #116946 (comment).

Oh, I forgot how complicated the issue is. I tried to summarize the issue: #116946 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

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

@skirpichev

skirpichev commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Ok, I don't think it worth to keep this open without a clear consensus in the issue thread.

vstinner 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.

@skirpichev skirpichev closed this Nov 6, 2026
@skirpichev
skirpichev deleted the decimal-nogc/116946 branch November 6, 2026 22:22
@skirpichev
skirpichev restored the decimal-nogc/116946 branch November 7, 2026 08:27
@skirpichev
skirpichev deleted the decimal-nogc/116946 branch November 7, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review

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.

2 participants

@skirpichev @vstinner
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.