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

Improve anonType resolution by double checking shape to reduce hash collisions #29928

Closed
grainier opened this issue Apr 8, 2021 · 0 comments
Closed
Labels
Area/JVMCodeGen JVM code generation module Priority/Low Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Improvement

Comments

@grainier
Copy link
Contributor

grainier commented Apr 8, 2021

Description:
$title.

Describe your problem(s)
n/a

Describe your solution(s)
Use double-checks to reduce hash collisions. i.e:

switch(var2.hashCode()) {
        case 105: // 1st check hash
            if (var2.equals("i")) { // 2nd check shape
                return this.i;
            }
            break;
        case 106:
            if (var2.equals("j")) {
                return this.j;
            }
        }

Related Issues (optional):

@grainier grainier added Type/Improvement Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Apr 8, 2021
@grainier grainier self-assigned this Apr 8, 2021
@grainier grainier added the Area/JVMCodeGen JVM code generation module label Jun 19, 2021
@grainier grainier removed their assignment Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/JVMCodeGen JVM code generation module Priority/Low Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Improvement
Projects
None yet
Development

No branches or pull requests

3 participants