Visitar URL original
bpo-46235: Do all ref-counting at once during list/tuple multiplication by sweeneyde · Pull Request #30346 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20251017020609/https://github.com/python/cpython/pull/30346
Skip to content

Conversation

sweeneyde
Copy link
Member

@sweeneyde sweeneyde commented Jan 2, 2022 •

See the bpo issue for benchmarks.

https://bugs.python.org/issue46235

@sweeneyde sweeneyde added the performance Performance or resource usage label Jan 2, 2022
@sweeneyde
Copy link
Member Author

Flattening the nested loops into a single sweep seems to have really helped. Fewer branch mis-predictions or something. More detailed numbers are listed in the bpo issue, but I measured Geometric mean: 1.32x faster on GCC and Geometric mean: 1.21x faster on MSVC across the grid of benchmarks.

@sweeneyde
Copy link
Member Author

Is anyone with a commit bit interested in merging this?

@tim-one
Copy link
Member

tim-one commented Jan 8, 2022

You don't have a commit bit yet? That's just silly 😃

I'll commit now. Thanks!

@tim-one tim-one merged commit ad1d590 into python:main Jan 8, 2022
@sweeneyde sweeneyde deleted the list_repeat branch January 25, 2022 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance or resource usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants