|
Sponsored Links
Resources
Enterprise Java Research Library
Get Java white papers, product information, case studies and webcasts
|
News
News
News
|
Messages: 5
Messages: 5
Messages: 5
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
Can JIT'ed Code be Faster than Hardware Accelleration
Ever wonder what your code looks like once it has been digested by the javac compiler or the JIT? In his blog Mark Lam shows you all of this in the process of explaining how adaptive code can be faster than Java-specific processors.
The article starts with a description of hardware acceleration and how it has been helpful. For example, co-processors, processors for sound and graphics have proven to be quite useful in accelerating applications. Mark asserts that the success experienced in these specific cases has lead to the misconception that hardware acceleration can match the performance provided by a JIT.
To demonstrate just how a JIT can out perform hardware acceleration, Mark does an analysis of what happens when one executes a = a + b;. First, the byte code and then the assembler is listed just to show what exactly takes place. With these listings in place, Mark simply counts the number of instructions that both the accelerator and the JIT will execute. The assumption is that fewer instructions will execute in less time. There are mitigating factors.
Based on the StrongARM 1110 processor, under optimal conditions where all accessed memory is already in cache, each of the instructions will take at least one machine cycle (if I remember correctly). If there is a cache miss, memory accesses can take up to 4 machine cycles assuming no virtual memory paging stalls. Otherwise, it'll take a lot more time. Using a number of assumptions Mark proceeds to calculate the number of machine cycles needed to complete the addition.
The results, summarized in a table, clearly demonstrate that the general purpose CPU with a JIT consistently out performed hardware acceleration. Even though Mark recognizes that one may never realize the the speedups one as high as 83x), there is a recognizable performance boost.
Mark moves on to demonstrate how the situation is even better for JITs when one considers complex bytecodes, inlining and other tricks employed to optimize code. With all of these advantages one would begin to wonder if it is worth it to consider hardware accelerators for Java.
Regardless, the JPU does have value. While it cannot compete with a JIT in terms of performance, it will perform much better than a software interpreter. Another reason to use the JPU is for extremely memory constraint environments where you have absolutely no memory budget to spare. The JIT adds 10s to 100s of kilobytes of memory consumption. If this is not a cost that can be tolerated, a JPU may be the best solution for performance. There are reasons to be hopeful that Java processors may become useful outside of a few special cases. Mark ends by postulating that with an advanced Java processor there are some possibilities of the situation changing. While it may not speak for all cases, it will help in a number of common cases.
|
|
Message #227630
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re: Can JIT'ed Code be Faster than Hardware Accelleration
Today's JIT compiler from Sun is incredibly fast, once it kicks in it flys, especially in JSE 6.
C24 have done a lot of benchmarks, recently for Intel we were quoted in the release of their new 4 core CPU. We've done a lot of bench marking for Sun on AMD (although I have to say Intel's currently in the lead there). I'm in the process of working with Azul and getting some amazing figures on their new Vega2 CPUs (all 192 cores!).
When it come to hardware, I can't go into too much detail but let's just say we're speaking to Intel and DataPower and we could perhaps add Azul to the group too. I've seen what hardware can do and believe me it's pretty damned impressive. One of the big areas being investigated is serialization, that's still something that the fastest JIT still can't do much about.
My point? JIT and hardware are two different things, we need both to get the most out of a JVM. We're going to see some impressive things from both JIT and hardware in the coming months.
-John- CTO, C24 London, UK
|
|
Message #227641
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Absolutely true...
Anything that can be done in software can be done in hardware. There's nothing in his article proving that a hardware java cpu has to be slower than one in software.
Having said that, the cost and time of development issues tend to always favor general purpose CPUs for peak performance.
|
|
Message #227656
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Anyone remember Symbolics' LISP machine?
Symbolics of Cambridge -- then Burlington MA, used to make a LISP machine including an operating system etc. on top of a CPU specifically designed to run LISP.
Just got a sense of Deja Vu while reading about a Java CPU.
|
|
Message #227668
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Re: Absolutely true...
exactly.
in fact, the limits of the software are the underlying hardware. with a well designed cpu, at the software layer, the best you can do is to leverage it. most of the time, unfortunately, bottlenecks are proposed...
|
|
 |
New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com |
 |
 |
Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(November 2, Article)
SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options.
(September 28, Article)
Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team.
(September 22, Article)
Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies.
(July 14, Article)
JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags.
(June 29, Article)
In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project.
(June 23, Tech Talk)
Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements.
(June 15, Tech Talk)
In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls.
(June 4, Tech Talk)
Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable.
(May 28, Tech Talk)
This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work.
(May 26, Tech Talk)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application.
(May 19, Article)
In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources.
(May 19, Tech Talk)
Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)
The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)
|
|