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

[native] Box most enums #632

Merged
merged 2 commits into from
Jan 28, 2022
Merged

[native] Box most enums #632

merged 2 commits into from
Jan 28, 2022

Conversation

zsol
Copy link
Member

@zsol zsol commented Jan 27, 2022

Summary

This PR resolves most large_enum_variant warnings from clippy. Based on my relatively unscientific benchmarking, this provides a ~30% speedup and ~20% less memory use while parsing the expr.py test fixture.

This PR also eliminates stack overflows in unittests on windows, and makes #619 much less likely (the parser can handle ~4000 deep nested binary operators, which should be more than enough 😝 )

Test Plan

After building, ran time native/target/release/parse -n < native/libcst/tests/fixtures/expr.py

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants