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

Speedup monomorphic switch type #38191

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

franz1981
Copy link
Contributor

@franz1981 franz1981 commented Jan 15, 2024

This could hit a performance issue (see https://stackoverflow.com/questions/44988841/force-tableswitch-instead-of-lookupswitch), because the default -XX:MinJumpTableSize is 10 and beyond it, the JIT would produce a jump table, instead of having a sort-of binary search among cases, just using a cascade of if.

This could be alleviated in different ways, like grouping the mostly expected handler(s) type in a main switch and have another "slower path" switch for known but still usually not present handler types.

@franz1981
Copy link
Contributor Author

@geoand let me put it in draft, this is mostly to experiment, if you wanna give it a shot

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

At the very least, this looks cleaner :)

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

Successfully merging this pull request may close these issues.

3 participants