[13] RFR (M): 8223213: Implement fast class initialization checks on x86-64

David Griffiths david.griffiths at gmail.com
Thu May 9 14:17:07 UTC 2019


Interestingly I have just come across this thread after hitting the
same problem myself. In my case I had code in a static initializer
specifically designed to make sure a method is JIT compiled (long
story). I reduced it down to this test:

public class Regression {
    static {
        System.out.println("start of loop");
        for (int i = 0; i < 10000000; i++) {
            check();
        }
        System.out.println("end of loop");
    }

    public static void check() {
    }

    public static void main(String[] args) {
        System.out.println("in main");
    }
}

which takes about 5 secs now compared to 0.07 secs user before.

Cheers,

David


More information about the hotspot-dev mailing list