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

Enable Pattern Matching for switch for better readability on the server side #866

Closed
JamesChenX opened this issue Nov 19, 2021 · 2 comments
Labels
Milestone

Comments

@JamesChenX
Copy link
Member

JamesChenX commented Nov 19, 2021

After testing, we can only get a little improvement for readability after adopting this feature. So we hold on until Pattern Matching for switch becomes a standard feature from a preview feature.

@JamesChenX JamesChenX added the enhancement New feature or request label Nov 19, 2021
@JamesChenX JamesChenX added this to the 1.0.0 milestone Nov 19, 2021
@JamesChenX
Copy link
Member Author

JamesChenX commented Nov 19, 2021

Due to the performance of Pattern Matching for switch is worse than the traditional if-else (according to the implementation of Pattern Matching for switch in java.lang.runtime.SwitchBootstraps#doTypeSwitch), we only use Pattern Matching for switch for verbose expressions like:
image

@JamesChenX
Copy link
Member Author

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant