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 — bpo-24076: Inline single digit unpacking in the integer fastpath of sum() by scoder · Pull Request #28469 · python/cpython

Conversation

@scoder

@scoder scoder commented Sep 20, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This gave me a 17% speedup last time I tried (3 years ago). Most integers that go into sum() should fit into a single PyLong digit, so this seems worth it.

https://bugs.python.org/issue24076

Sorry, something went wrong.

Uh oh!

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

All reactions
@scoder
bpo-24076: Inline single digit unpacking in the integer fastpath of s…
d33815a
…um().
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 20, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Sep 20, 2021
scoder added 2 commits September 20, 2021 10:17
@scoder
Add News entry.
f9a17db
@scoder
Add a comment.
125cdcf
rhettinger
rhettinger reviewed Sep 20, 2021
View reviewed changes
Comment thread Python/bltinmodule.c Resolved

Uh oh!

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

rhettinger
rhettinger approved these changes Sep 20, 2021
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Sep 20, 2021
@scoder
scoder merged commit debd804 into python:main Sep 21, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label Sep 21, 2021
@scoder
scoder deleted the bpo-24076_faster_int_sum branch September 21, 2021 09:01
niyas-sait pushed a commit to niyas-sait/cpython that referenced this pull request Sep 21, 2021
@scoder @niyas-sait
bpo-24076: Inline single digit unpacking in the integer fastpath of s…
c6666ed
…um() (pythonGH-28469)
@pablogsal

pablogsal commented Sep 21, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Unfortunately commit debd804 introduced a reference leak:

❯ ./python -m test test_grammar -R :
0:00:00 load avg: 2.96 Run tests sequentially
0:00:00 load avg: 2.96 [1/1] test_grammar
beginning 9 repetitions
123456789
.........
test_grammar leaked [12, 12, 12, 12] references, sum=48
test_grammar failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
test_grammar

Total duration: 1.1 sec
Tests result: FAILURE

debd804 is the first bad commit
commit debd804
Author: scoder [email protected]
Date: Tue Sep 21 11:01:18 2021 +0200

[bpo-24076](https://bugs.python.org/issue24076): Inline single digit unpacking in the integer fastpath of sum() (GH-28469)

.../Core and Builtins/2021-09-20-10-02-12.bpo-24076.ZFgFSj.rst | 1 +
Python/bltinmodule.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-09-20-10-02-12.bpo-24076.ZFgFSj.rst

All reactions

Sorry, something went wrong.

Uh oh!

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

pablogsal added a commit to pablogsal/cpython that referenced this pull request Sep 21, 2021
@pablogsal
bpo-24076: Fix reference in sum() introduced by pythonGH-28469
bd121ec
@pablogsal

pablogsal commented Sep 21, 2021

Copy link
Copy Markdown
Member

Opened #28493 to fix the refleak

All reactions

Sorry, something went wrong.

Uh oh!

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

pablogsal added a commit that referenced this pull request Sep 21, 2021
@pablogsal
bpo-24076: Fix reference in sum() introduced by GH-28469 (GH-28493)
1c7e98d
@ambv ambv mentioned this pull request Oct 20, 2022
sum() several times slower on Python 3 64-bit #68264
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rhettinger rhettinger rhettinger approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

5 participants

@scoder @pablogsal @rhettinger @the-knights-who-say-ni @bedevere-bot
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.