Re:If Java Is Dying, It Sure Looks Awfully Healthy
by alpatters on Thursday October 10, 2013 @06:44AM
(#6526708)
You're wrong. http://en.wikipedia.org/wiki/Profile-guided_optimization
The method for C/C++ is just different to JIT. Compile program, collect profile information, optimize program guided by profile information.
Re:If Java Is Dying, It Sure Looks Awfully Healthy
by astral303 on Thursday October 10, 2013 @09:32AM
(#6527513)
There's far more than branch prediction optimization, which AFAIK, is bread and butter of profile-guided optimization.
Even that assumes that your program does not significantly shift its behavior mid-execution--in fact, you're optimizing for the average, not the current case.
One of the coolest JIT things is ability to inline virtual calls. Think about that, I could have my code calling a 3rd party library calling another 3rd party library thru 10 levels of stack and if all that call ever returns is "false", then JIT will optimize right through all that.
I don't believe PGO does virtual call inlining. That's a C++ nonstarter. In C, the equivalent would be inlining for function pointer calls.
Re:If Java Is Dying, It Sure Looks Awfully Healthy
by camus on Thursday October 10, 2013 @01:03AM
(#6525739)
doesnt matter,the jvm takes a lot of resources which is problematic is some situations.raw speed is nothing without the memory footprint or AAA games would be written in java.they are not for a good reason:lack of direct memoy management.
Re:If Java Is Dying, It Sure Looks Awfully Healthy
by rdtsc on Thursday October 10, 2013 @02:06AM
(#6525935)
I am not saying one should use it or not, or how it is strictly better than something else, just saying I can easily see _in theory_ how a jit compiler written in C can be faster than plain C.
Easy. JVM has runtime information it can use that C compiler simply doesn't have. There are some synthetic benchmarks that show how "java is faster than C".