Skip to content

bpo-46235: Do all ref-counting at once during list/tuple multiplication#30346

Merged
tim-one merged 4 commits into
python:mainfrom
sweeneyde:list_repeat
Jan 8, 2022
Merged

bpo-46235: Do all ref-counting at once during list/tuple multiplication#30346
tim-one merged 4 commits into
python:mainfrom
sweeneyde:list_repeat

Conversation

@sweeneyde

@sweeneyde sweeneyde commented Jan 2, 2022

Copy link
Copy Markdown
Member

See the bpo issue for benchmarks.

https://bugs.python.org/issue46235

@sweeneyde sweeneyde added the performance Performance or resource usage label Jan 2, 2022
Comment thread Objects/listobject.c
Comment thread Objects/listobject.c Outdated
@sweeneyde

Copy link
Copy Markdown
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
Copy Markdown
Member Author

Is anyone with a commit bit interested in merging this?

@tim-one

tim-one commented Jan 8, 2022

Copy link
Copy Markdown
Member

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