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

Is jdk11 not optimized when changing to JIT optimization? #19520

Open
lts0609 opened this issue May 21, 2024 · 3 comments
Open

Is jdk11 not optimized when changing to JIT optimization? #19520

lts0609 opened this issue May 21, 2024 · 3 comments

Comments

@lts0609
Copy link

lts0609 commented May 21, 2024

When I execute the following code, I see that there are clear differences between different jdk versions, I try to force compilation using the JIT option count=0, and the test will run in ten seconds. Is this because the JIT did not identify the code that needs to be optimized, resulting in a performance difference?

public class Test { 
    static int[] LoopTest(int a, int limit, int[] arr) {
        while (a-- != Integer.MIN_VALUE) {
            if (arr[arr.length - 1] >= limit)
            break;
            }
        return arr;
        }
    public static void main(String[] args) throws Exception {
        int limit = 8;
        int a= 998376598;
        int[] arr = {2,-1};
        LoopTest(a, limit, arr);
    }
}
    

openj9-21.0.1

real 1m41.887s
user 1m41.685s
sys 0m0.677s
openj9-11.0.14 Test

real 0m46.642s
user 0m46.825s
sys 0m0.137s

openj9-21.0.1/bin/java -Xjit:count=0 Test

real 0m7.735s
user 0m7.326s
sys 0m0.542s

@lts0609
Copy link
Author

lts0609 commented May 21, 2024

When I run the code using hotspot-jdk8u352 the result is only 0.664s

@pshipton pshipton added the perf label May 21, 2024
@pshipton
Copy link
Member

pshipton commented May 21, 2024

Some of the comments in #19057 (comment) might apply here as well.

@hzongaro fyi

@lts0609
Copy link
Author

lts0609 commented May 23, 2024

Thank you for your answer. Could you please tell me why openj9 and hotspot have the same JIT optimization, but the running time of openj9 is still higher than that of hotspot. Is this because the optimization processing of openj9 and hotspot is different?

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

2 participants