GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — gh-87613: Use AC and AC vectorcall for filter by cmaloney · Pull Request #160792 · python/cpython Conversation
|
| 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))
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.