Skip to content

Optimize option chaining #7457

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

Open
cknitt opened this issue May 10, 2025 · 0 comments
Open

Optimize option chaining #7457

cknitt opened this issue May 10, 2025 · 0 comments
Milestone

Comments

@cknitt
Copy link
Member

cknitt commented May 10, 2025

There is currently a performance penalty due to the extra function call when using Option.map/flatMap/forEach instead of a switch statement.

The compiler could optimize/inline these calls. (Same for Null/Nullable actually, but less important IMHO as Option is more widely used.)

@cknitt cknitt added this to the v12 milestone May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant