Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-104787: use bitfields in _asyncio #104788

Merged
merged 9 commits into from
Jun 13, 2023
Merged

Conversation

kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented May 23, 2023

This reduces size of asyncio.Task from 176 to 160 bytes.

@kumaraditya303 kumaraditya303 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 23, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit a8d96e0 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 23, 2023
@itamaro
Copy link
Contributor

itamaro commented May 23, 2023

9% memory win per task object is great!
did you measure how it impacts macro benchmarks (perf and memory)?

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

LGTM, though using char instead of bitfields would also work, and possibly feel less fragile.

@gvanrossum
Copy link
Member

@kumaraditya303 How do you want to proceed here?

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

LGTM, except I'd like to see a comment about the need for various small fields to be at the end of the common struct or at the beginning of the specific struct.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

(A more appropriate term would be "contiguous".)

@kumaraditya303
Copy link
Contributor Author

(A more appropriate term would be "contiguous".)

Yes that's what I was looking for but late so didn't came to mind :)

@kumaraditya303 kumaraditya303 merged commit 829ac13 into python:main Jun 13, 2023
@kumaraditya303 kumaraditya303 deleted the bitfield branch June 13, 2023 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage skip news topic-asyncio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants