cs0x7f / sq12phase

square one solver
5 stars 1 forks source link

Initialization in Java seems slow #2

Closed jfly closed 12 years ago

jfly commented 12 years ago

I added timing of the initialization to Search.java (see https://github.com/jfly/sq12phase/commit/12752059ae7d6f3e46dc21b50b6eb1764b458bd3). I'm seeing times like

2.87255555 seconds to initialize 2.644265412 seconds to initialize 2.640455625 seconds to initialize

which is a lot slower than the nearly instantaneous speed of the js on http://www.cubing.net/mark2/#competition_name=&rounds=%5B%5B%22sq1%22%2C%22Round%201%22%2C1%2C5%5D%5D.

cs0x7f commented 12 years ago

Because the java virtual machine spends much time checking whether static data is available(or has been initialized) before the static initialization function of the class has finished.

jfly commented 12 years ago

This seems to be fixed by a4ea1f72ed97fce4190bdc817a2a626211171827, thanks!