• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tiered Compilation  RSS feed

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been reading about Tired Compiliation support which has been added in java 7.

I don't exactly get it why it is used for.

So will this compiler be useful for client applications or only server applications.

Snippet from Java Site

Tiered Compilation

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.

Both 32 and 64 bit modes are supported, as well as compressed oops (see the next section). Use the -XX:+UseTieredCompilation flag with the java command to enable tiered compilation.

So when will this kind of of compilation will be useful to us?

Thanks
Shashank

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tiered just-in-time compiler is a combination of the -client just-in-time compiler and the -server just-in-time compiler. With it, you can get the best of both options. For infrequently used code, you get the compilation to native code immediately. For more frequently used code, you get the optimized (with profiling) compilation to native code (once the code has ran long enough to complete profiling of course).

Nikhil Jain wrote:
So will this compiler be useful for client applications or only server applications.


Keep in mind that the concept of client and server application is just a designation. To the JVM, one is for short lived programs and the other is for long lived programs. And from this, whether the user believes that the code will be around long enough to warrant profiling the application to do an optimized compilation. You can run any program (client or server) in either mode.

This tiered compiler is useful for client programs that are not short lived. This tiered compiler is also good for components of server programs that are not run frequently. And the user doesn't have to decide whether the program is to be treated as a client or server; it gets treated as a client first, and portions get upgraded to be treated as a server, as it is profiled.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!