9

I would like to know what are the loop optimizations performed by Oracle Java 7 (or 8) Hotspot VM?

Lii
  • 11,553
  • 8
  • 64
  • 88
El Marce
  • 3,144
  • 1
  • 26
  • 40
  • 3
    The compiler writers possibly could ... but I doubt that they would. Anyway, if you really need to know you can always download the OpenJDK source tree and figure it out for yourself. – Stephen C Oct 01 '15 at 14:33
  • The main ones will probably be deadcode elimination, loop unrolling and variable hoisting. – assylias Oct 01 '15 at 14:45
  • 4
    @ The close voters: In how far is this asking for an off-site resource? Look at the current answer. (Of course, it has lots of links in it, but these are only pointers to a durable resource (namely, the OpenJDK source), and intended for further research). – Marco13 Oct 03 '15 at 13:41
  • 2
    @ The close voters: I have edited my question 2 days a go. Can you check this please? Thanks – El Marce Oct 06 '15 at 10:31

1 Answers1

28
El Marce
  • 3,144
  • 1
  • 26
  • 40
Ivan Mamontov
  • 2,874
  • 1
  • 19
  • 30
  • you did a hell of research here! +Integer.MaxInt to you! – El Marce Feb 23 '16 at 12:36
  • 3
    Very helpful! Her's some complementary info: [VectorizaAon in HotSpot JVM by Vladimir Ivanov, HotSpot JVM Compiler, Oracle Corp. April 8, 2017](http://cr.openjdk.java.net/~vlivanov/talks/2017_Vectorization_in_HotSpot_JVM.pdf) – apete Oct 28 '17 at 07:56
  • 1
    More recent version of that great presentation: http://cr.openjdk.java.net/~vlivanov/talks/2019_CodeOne_MTE_Vectors.pdf – Antoine CHAMBILLE Jan 06 '21 at 16:26