Calling in the geeks
Originally Posted by Traveler,Sep 30 2008, 01:33 AM
But still, 200000 to 1 makes me think that the Java program was just poorly written.
This professor is pretty sharp from what I could tell.
Still even giving away 2 orders of magnitude that is still a remarkable difference in performance.
Originally Posted by Traveler,Sep 29 2008, 09:33 PM
The machine code it compiles into will still be making a lot of calls to the JVM runtime to create and delete objects, ask for addresses of existing objects, make method calls, and probably much more.
Anyway, here is a technique from the hardware side that can be applied to the JVM. Let's say the code is coming to a conditional branch, and we don't know in advance which way the branch is going to go (it is still waiting for the branch condition to be computed). What the HW does is to fire off two threads, one executing the true path and the other executing the false path. Once the branch condition is determined, the "good" thread is "committed" and the "bad" thread is killed. For the JVM, it could fire off two threads and start executing both paths simultaneously and then committ to the good one later. This can take advantage of multiple cores. Of course, you can extrapolate this and quickly deduce that given the frequency of conditional branches in today's code, starting two paths will quickly "branch" out to many paths and suck up all available cores. Just a thought.
Thread
Thread Starter
Forum
Replies
Last Post








