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-87613: Use AC and AC vectorcall for filter by cmaloney · Pull Request #160792 · python/cpython

Conversation

@cmaloney

@cmaloney cmaloney commented Oct 28, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Move filter.__new__ to Argument Clinic with @vectorcall, dropping the hand-written filter_new and filter_vectorcall. The performance delta is within noise on my machine.

pyperf microbenchmark (PGO+LTO, run serially), no significant change on the vectorcall path:

Benchmark base filter
filter.__new__ 45.4 ns 42.7 ns: 1.06x faster
filter(bool, list) 32.3 ns 32.8 ns: 1.01x slower
filter(None, range) 30.6 ns 31.8 ns: 1.04x slower
Geometric mean (ref) 1.01x faster

Benchmark hidden because not significant (3): subclass(None, tuple), filter(None, tuple), list(filter(None, list))

  • Issue: Generate vectorcall code to parse arguments using Argument Clinic #87613

Sorry, something went wrong.

Uh oh!

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

All reactions
@cmaloney @claude
pythongh-87613: Use AC vectorcall for filter
a4134f3
Move filter.__new__ to Argument Clinic with @vectorcall, dropping the
hand-written filter_new and filter_vectorcall. The generated vectorcall
name matches the hand-written one so the tp_vectorcall slot is unchanged,
and argument error messages are unchanged on both paths.

pyperf microbenchmark (PGO+LTO, run serially), no significant change on
the vectorcall path:

| Benchmark           | base    | filter                |
|---------------------|:-------:|:---------------------:|
| `filter.__new__`    | 45.4 ns | 42.7 ns: 1.06x faster |
| filter(bool, list)  | 32.3 ns | 32.8 ns: 1.01x slower |
| filter(None, range) | 30.6 ns | 31.8 ns: 1.04x slower |
| Geometric mean      | (ref)   | 1.01x faster          |

Benchmark hidden because not significant (3): subclass(None, tuple),
filter(None, tuple), list(filter(None, list))

filter.__new__ drops PyArg_UnpackTuple for inline clinic parsing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cmaloney cmaloney added the skip news label Oct 28, 2026
@cmaloney
cmaloney requested a review from ericsnowcurrently as a code owner October 28, 2026 00:36
@bedevere-app bedevere-app Bot added awaiting review type-feature A feature request or enhancement labels Oct 28, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Oct 28, 2026
Generate vectorcall code to parse arguments using Argument Clinic #87613
Open
msullivan
msullivan approved these changes Oct 28, 2026
View reviewed changes

@msullivan msullivan left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Oct 28, 2026
eendebakpt
eendebakpt approved these changes Oct 28, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Oct 28, 2026
@cmaloney @claude
Merge remote-tracking branch 'upstream/main' into ac_vc_filter
78f4300
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cmaloney
cmaloney merged commit 7e3290d into python:main Nov 3, 2026
53 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 3, 2026
@cmaloney
cmaloney deleted the ac_vc_filter branch November 3, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@msullivan msullivan msullivan approved these changes
@eendebakpt eendebakpt eendebakpt approved these changes
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news type-feature A feature request or enhancement

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

@cmaloney @msullivan @eendebakpt
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.