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

Save 4 bytes on every ArgInfo by deleting rebind #6629

Open
jez opened this issue Dec 19, 2022 · 0 comments
Open

Save 4 bytes on every ArgInfo by deleting rebind #6629

jez opened this issue Dec 19, 2022 · 0 comments
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers

Comments

@jez
Copy link
Collaborator

jez commented Dec 19, 2022

Problem

ClassOrModuleRef rebind;

Every ArgInfo stores a rebind right now.
But the only arg for which the rebind matters is the block arg.
Every method has a block arg (but not every block has a meaningful rebind).

Proposed solution

Using these facts, we may as well store the rebind only on the Method instead of on all ArgInfo even the non-block-arg ArgInfo.

I think this will only save something like single-digit megabytes of resident memory on Stripe's code base, but it also has the property that it models things more closely to how inference actually works, so I think it's a win anyways.

@jez jez added enhancement New feature or surprising current feature good first issue Good for newcomers labels Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant