|
|
|
|
|
by flukus
3317 days ago
|
|
In an artificial benchmark they are pretty similar, but in real world idiomatic code they are very different to c++. Nearly everything is on the heap so you've got pointers everywhere, dynamic data structures are used everywhere, virtual functions (particularly with java) and interfaces. There's is a reason java was so much slower than native code 20 years ago and that gap has been bridged by CPU progress more then compiler progress. |
|
I lost count how many times I have reviewed code where a for loop is used instead of System.arrayCopy().
Or the times I have seen code that my CS data structures teacher would probably give a plain 0, even if done in C.