Блог пользователя Flatfoot

Автор Flatfoot, 10 лет назад, По-английски

I submitted the problem 20C - Dijkstra? with two different Java compilers. The results are as follows:

Java 7: 7625239 Time: 466 ms Memory: 12400 KB

Java 8: 7625386 Time: 1184 ms Memory: 8500 KB

I expected Java 8 to be faster. However, to my surprise the program runs more than two times slower under Java 8 than under Java 7 which really surprised me! Does anyone have an explanation for this or experienced something similar?

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

...Java 8 is much slower than Java 7. Running an app using Java 8, I noticed a significant delay. I had to downgrade to Java 7 to get performance back to acceptable speed level.

»
9 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

I think that Petr, Egor and andrewzta should know a good explanation for that.

I think it is probably something like "Java 8 takes more time for more clever JIT-optimization in a hope that program will be long-living" (which is false on competitions) or just another garbage collection strategy.