Java 7 Groovy twice as fast as Java 8 and 9
martijnverburg at gmail.com
Tue Feb 17 10:24:40 UTC 2015
>From the Docs:
"Tiered compilation, introduced in Java SE 7, brings client startup speeds
to the server VM. Normally, a server VM uses the interpreter to collect
profiling information about methods that is fed into the compiler. In the
tiered scheme, in addition to the interpreter, the client compiler is used
to generate compiled versions of methods that collect profiling information
about themselves. Since the compiled code is substantially faster than the
interpreter, the program executes with greater performance during the
profiling phase. In many cases, a startup that is even faster than with the
client VM can be achieved because the final code produced by the server
compiler may be already available during the early stages of application
initialization. The tiered scheme can also achieve better peak performance
than a regular server VM because the faster profiling phase allows a longer
period of profiling, which may yield better optimization."
In layperson terms:
Compile some of the initial hot methods into machine code and get them to
profile themselves at top speed. Use that to feed into the JIT for the full
C2 compilation phase for the rest of the eligible code.
On 17 February 2015 at 10:12, Richard Kolb <rjdkolb at gmail.com> wrote:
> Hi Chris.
> I would really appreciate it if you could run it through JITWatch, thanks.
> I have not considered hitting tiered compilation, actually I needed to
> google what that means. :)
> The tests go though the normal JMH warmups, so I am guessing that is
> avoided ?
> If it helps, I've attached the results from the run in Java 9,8 and 7.
> On 17 February 2015 at 11:56, Richard Kolb <rjdkolb at gmail.com> wrote:
>> Hi Martijn.
>> Thanks very much.
>> Let me ask Aleksey first and see if my micro benchmark is at least sane.
>> I'll post his response.
>> (I realised my Java 9 was out of date. Build 48 returns similar results.)
>> Hi Richard,
>> This is a good one to ask Aleksey and other performance experts! You can
>> try the friends of jclarity list (disclaimer, I run jclarity) to get advice
>> from the industry or in OpenJDK I'd probably recommend posting to code
>> tools or the relevant hotspot mailing list.
>> On 17 February 2015 at 06:18, Richard Kolb <rjdkolb at gmail.com> wrote:
>>> Hello All,
>>> I've created my own micro beanchmarks with jmh.
>>> It's forked to here :
>>> Most of the benchmarks clearly show how performance is increasing except
>>> for Groovy.
>>> Perhaps my benchmark is wrong, but it looks like 8 and 9 are
>>> slower than 7.
>>> Java 7 (build 1.7.0_60-b19):
>>> c.g.v.DynamicLanguages.groovy 665.826 ops/s
>>> Java 8 (build 1.8.0_31-b13):
>>> c.g.v.DynamicLanguages.groovy 366.274
>>> Java 9 (build 1.9.0-ea-b42) :
>>> c.g.v.DynamicLanguages.groovy 375.593 ops/s
More information about the adoption-discuss