Safepoints

(4th Dec2016)
Came across an article explaining about safepoints.

Safepoints: http://psy-lob-saw.blogspot.co.uk/2015/12/safepoints.html

Counted and uncounted loops: http://psy-lob-saw.blogspot.co.uk/2016/02/wait-for-it-counteduncounted-loops.html
This article explained difference between counted and uncounted loops. While compiling depending on whether JVM considers the loop as counted or non-counted it decides to put safepoint in the loop (usually at the end of the loop). If loop is a counted loop (considered as small enough) JVM does not put the safepoint in it.
Post pointed out that there is a difference between the generated code for OSR and non-OSR compilation by JVM.
In the post it is also recommended to use JMH for running benchmarks on Java.

What is OSR - Cliff Click : http://www.cliffc.org/blog/2011/11/22/what-the-heck-is-osr-and-why-is-it-bad-or-good/
This article elaborated why OSR compilation may result in a less efficient code. It showed an example where the structure of a simple nested loop got distorted as OSR version. It is because the compiled code should be in such way that it starts on the back edage of the loop.
Given example shows that the nested loop gets re-ordered. As OSR starts from the middle of the loop, it's difficult do certain types of optimization. e.g. doing range-check-elimination on an array A[i++].

results matching ""

    No results matching ""