![]() |
2011-02-08
, 20:10
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#122
|
Even with LLVM, you will suffer if you have used pointers in C++/C program. You just have to throw many of the optimization techniques down the drain when there is a pointer inside some basic block.
Where is this obvious in the post?
The post links to academic papers, rather than pure anecdote.
![]() |
2011-02-08
, 20:15
|
|
Posts: 3,524 |
Thanked: 2,958 times |
Joined on Oct 2007
@ Delta Quadrant
|
#123
|
Huh ? The guy explains fairly solidly in what way were the original C++ benchmarks inferior in terms of unoptimal code, i.e. things not done as one would if he was thinking with a 'C++ head' instead of just porting the Java code to C++.
It's bull****, pardon my language. I have yet to see a benchmark that does not fall into the trap of the author being more proficient with one language than the other, and therefore skewing the results by his 'stronger' language getting a bias. Or you know, realizing that there are different C++ compilers in the world. 3 years ago, most of my Java apps beat my C++ apps speedwise, simply because I knew a lot better how Java works and what is expensive. Nowadays, my C++ runs circles around my Java. So there, there is only one language benchmark that is worth more than a dime - real life.Another, good link explaining why interpreted code can be faster than fully compiled one, beside the two I already mentioned and which may be too technical and theoretic, is this:
http://scribblethink.org/Computer/javaCbenchmark.html
(It is kind of "old" also, but the facts haven't changed since then.)
Here is a relatively fresh benchmark test between Java and C++:
It's a tie!
The Following User Says Thank You to Capt'n Corrupt For This Useful Post: | ||
![]() |
2011-02-08
, 20:33
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#124
|
My question is: where is "all into the trap of the author being more proficient with one language than the other, and therefore skewing the results by his 'stronger' language getting a bias" in the link?
The Following User Says Thank You to attila77 For This Useful Post: | ||
![]() |
2011-02-08
, 20:55
|
|
Posts: 3,524 |
Thanked: 2,958 times |
Joined on Oct 2007
@ Delta Quadrant
|
#125
|
I don't see what your issue with that is... "I have yet to see" clearly said that this is my personal impression. It certainly is anecdotal as it draws on my Java/C++ sw developer experience, which has not been published in any IEEE proceedings, but that is exactly the reason why I case-in-point listed and linked information that goes to demonstrate that the original benchmark in question is indeed in no way conclusive.
The Following User Says Thank You to Capt'n Corrupt For This Useful Post: | ||
![]() |
2011-02-08
, 21:21
|
Posts: 1,341 |
Thanked: 708 times |
Joined on Feb 2010
|
#126
|
Again, these are the little 'a-ha !' type of rhetorical battles. You say that, I say yeah, but C++ can do stack allocations which eat Java's heap allocation for breakfast, what about casting... And so forth. Each platform has a set of "I do this better than the other one !" and that's why it's so difficult (=impossible) to do a proper comparison.
![]() |
2011-02-09
, 03:02
|
Posts: 303 |
Thanked: 146 times |
Joined on Aug 2009
|
#127
|
But I'm not talking about future potential or speed comparisons. What I *am* implying is that there are many factors (eg. cultural) that stand in the way of development using VM. In the case of game development, game developers seem to love C++. And in my experience the most vocal of developers loath change.
But fast games *can* be coded in VM environments (see below). Hell even fast fully 3D games (w/ shaders) can be coded using Javascript (case and point: google's O3D). This was also before many of the fast optimizations to V8 (eg native compilation).
1) the latest Dalvik implementation compiles often used traces into native code with little memory penalty -- ~96-98% computed cycles are native including jumps at around 80KB memory penalty; put another way, very little time is actually spent in the interpreter and the memory consumption is negligible.
2) GC is largely controllable by the developer -- don't allocate new objects/temporary objects -- also, I think in Android the collector can be triggered by the developer (could be wrong). Bottom line, optimization is still a very active process regardless of the environment.
3) Core libraries are natively compiled and VM code (JIT or interpreted) simply calls them.
These are available today. I'm not saying that these optimizations are faster than native. What I *am* saying is that they are fast enough for most tasks -- even the intensive ones: games.
As the JIT trace compile optimizations become more mature, this will improve still, and I suspect the differences between compiled C/C++ and .dex to be negligible.
Bottom line? In this test, non-recursive code is as fast as native compiled code. Recursive is another story altogether, but again, recursive code can be unrolled in the optimization step of development.
The Following User Says Thank You to Radu For This Useful Post: | ||
![]() |
2011-02-09
, 10:56
|
|
Posts: 3,524 |
Thanked: 2,958 times |
Joined on Oct 2007
@ Delta Quadrant
|
#128
|
![]() |
2011-02-09
, 11:11
|
|
Posts: 3,524 |
Thanked: 2,958 times |
Joined on Oct 2007
@ Delta Quadrant
|
#129
|
![]() |
2011-02-09
, 11:20
|
Posts: 376 |
Thanked: 511 times |
Joined on Aug 2009
@ Greece
|
#130
|
The Following 2 Users Say Thank You to v13 For This Useful Post: | ||
![]() |
Tags |
bada rox, dalvik, future, java haters, meego, meego?fail, nokia, sandbox sucks |
|
The post links to academic papers, rather than pure anecdote.